Skip to content

Commit f158c66

Browse files
committed
Don't poll iCasa Pulse keypads for battery percentage
It appears these keypads report battery percentage periodically after all, slightly under every four hours. see #1509 (comment) and #1124.
1 parent d81cd52 commit f158c66

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

de_web_plugin.cpp

+26-26
Original file line numberDiff line numberDiff line change
@@ -4419,7 +4419,7 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const SensorFi
44194419
sensorNode.setManufacturer("OSRAM");
44204420
}
44214421
}
4422-
else if ((node->nodeDescriptor().manufacturerCode() == VENDOR_119C))
4422+
else if ((node->nodeDescriptor().manufacturerCode() == VENDOR_119C))
44234423
{
44244424
sensorNode.setManufacturer("Sinope");
44254425
}
@@ -7567,16 +7567,16 @@ bool DeRestPluginPrivate::processZclAttributes(Sensor *sensorNode)
75677567
}
75687568
}
75697569

7570-
if (sensorNode->mustRead(READ_BATTERY) && tNow > sensorNode->nextReadTime(READ_BATTERY))
7571-
{
7572-
std::vector<uint16_t> attributes;
7573-
attributes.push_back(0x0021); // battery percentage remaining
7574-
if (readAttributes(sensorNode, sensorNode->fingerPrint().endpoint, POWER_CONFIGURATION_CLUSTER_ID, attributes))
7575-
{
7576-
sensorNode->clearRead(READ_BATTERY);
7577-
processed++;
7578-
}
7579-
}
7570+
// if (sensorNode->mustRead(READ_BATTERY) && tNow > sensorNode->nextReadTime(READ_BATTERY))
7571+
// {
7572+
// std::vector<uint16_t> attributes;
7573+
// attributes.push_back(0x0021); // battery percentage remaining
7574+
// if (readAttributes(sensorNode, sensorNode->fingerPrint().endpoint, POWER_CONFIGURATION_CLUSTER_ID, attributes))
7575+
// {
7576+
// sensorNode->clearRead(READ_BATTERY);
7577+
// processed++;
7578+
// }
7579+
// }
75807580

75817581
return (processed > 0);
75827582
}
@@ -14097,21 +14097,21 @@ void DeRestPlugin::idleTimerFired()
1409714097
}
1409814098
}
1409914099

14100-
if (*ci == POWER_CONFIGURATION_CLUSTER_ID)
14101-
{
14102-
if (sensorNode->modelId().startsWith(QLatin1String("ICZB-KPD1"))) // iCasa Pulse keypads
14103-
{
14104-
val = sensorNode->getZclValue(*ci, 0x0021); // battery percentage remaining
14105-
if (!val.timestamp.isValid() || val.timestamp.secsTo(now) > 1800)
14106-
{
14107-
sensorNode->enableRead(READ_BATTERY);
14108-
sensorNode->setLastRead(READ_BATTERY, d->idleTotalCounter);
14109-
sensorNode->setNextReadTime(READ_BATTERY, d->queryTime);
14110-
d->queryTime = d->queryTime.addSecs(tSpacing);
14111-
processSensors = true;
14112-
}
14113-
}
14114-
}
14100+
// if (*ci == POWER_CONFIGURATION_CLUSTER_ID)
14101+
// {
14102+
// if (sensorNode->modelId().startsWith(QLatin1String("ICZB-KPD1"))) // iCasa Pulse keypads
14103+
// {
14104+
// val = sensorNode->getZclValue(*ci, 0x0021); // battery percentage remaining
14105+
// if (!val.timestamp.isValid() || val.timestamp.secsTo(now) > 1800)
14106+
// {
14107+
// sensorNode->enableRead(READ_BATTERY);
14108+
// sensorNode->setLastRead(READ_BATTERY, d->idleTotalCounter);
14109+
// sensorNode->setNextReadTime(READ_BATTERY, d->queryTime);
14110+
// d->queryTime = d->queryTime.addSecs(tSpacing);
14111+
// processSensors = true;
14112+
// }
14113+
// }
14114+
// }
1411514115
}
1411614116

1411714117
DBG_Printf(DBG_INFO_L2, "Force read attributes for SensorNode %s\n", qPrintable(sensorNode->name()));

de_web_plugin_private.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
#define READ_OCCUPANCY_CONFIG (1 << 10)
233233
#define READ_GROUP_IDENTIFIERS (1 << 12)
234234
#define READ_THERMOSTAT_STATE (1 << 17)
235-
#define READ_BATTERY (1 << 18)
235+
// #define READ_BATTERY (1 << 18)
236236

237237
#define READ_MODEL_ID_INTERVAL (60 * 60) // s
238238
#define READ_SWBUILD_ID_INTERVAL (60 * 60) // s

0 commit comments

Comments
 (0)