Support polling window covering lift state
Will be excecuted only brifly while reporting isn't configured yet. This also has the side effect that reporting will be configured/repaired.
@@ -40,9 +40,13 @@ void PollManager::poll(RestNodeBase *restNode, const QDateTime &tStart)
PollItem pitem;
if (!restNode->node()->nodeDescriptor().receiverOnWhenIdle())
+ {
+ auto *item = r->item(RAttrSleeper);
+ if (!item || item->toBool())
{
return;
}
+ }
LightNode *lightNode = nullptr;
Sensor *sensor = nullptr;
@@ -92,6 +96,15 @@ void PollManager::poll(RestNodeBase *restNode, const QDateTime &tStart)
pitem.items.push_back(suffix);
}
}
+ else if (lightNode && lightNode->type() == QLatin1String("Window covering device"))
+ {
+ if (suffix == RStateLift ||
+ suffix == RAttrModelId ||
+ suffix == RAttrSwVersion)
+ {
+ pitem.items.push_back(suffix);
+ }
+ }
else if (suffix == RStateOn ||
suffix == RStateBri ||
suffix == RStateColorMode ||
@@ -404,6 +417,17 @@ void PollManager::pollTimerFired()
attributes.push_back(0x0505); // RMS Voltage
attributes.push_back(0x0508); // RMS Current
}
+ else if (suffix == RStateLift)
+ {
+ clusterId = WINDOW_COVERING_CLUSTER_ID;
+ attributes.push_back(0x0008); // Current Position Lift Percentage
+
+ NodeValue &val = restNode->getZclValue(clusterId, 0x0008);
+ if (val.isValid() && val.maxInterval == 0)
+ {
+ val.maxInterval = 10;
+ }
+ }
else if (suffix == RAttrModelId)
{
item = r->item(RAttrModelId);
