Fix read multiple attributes from Window Covering Cluster
@@ -120,7 +120,6 @@ void DeRestPluginPrivate::handleWindowCoveringClusterIndication(const deCONZ::Ap
{
while(!stream.atEnd())
{
-
stream >> attrid;
if (isReadAttr)
{
@@ -137,15 +136,18 @@ void DeRestPluginPrivate::handleWindowCoveringClusterIndication(const deCONZ::Ap
{
stream >> attrValue;
}
+ // only read 16-bit values, i.e. attrTypeId 0x21,0x31,0x09,0x19,0x29
+ else if ( ((attrTypeId >> 4) <= 0x03 && (attrTypeId & 0x0F) == 0x01) || // 0x21,0x31
+ ((attrTypeId >> 4) <= 0x02 && (attrTypeId & 0x0F) == 0x09)) // 0x09,0x19,0x29
+ {
+ quint16 attrVal16;
+ stream >> attrVal16;
+ }
else
{
return;
}
-
- break;
- }
-
NodeValue::UpdateType updateType = NodeValue::UpdateByZclReport;
if (attrid == 0x0008) // current CurrentPositionLiftPercentage 0-100
@@ -206,7 +208,7 @@ void DeRestPluginPrivate::handleWindowCoveringClusterIndication(const deCONZ::Ap
Sensor *sensor = getSensorNodeForAddressAndEndpoint(ind.srcAddress(), 0x02);
if (sensor)
{
- ResourceItem *item = 0;
+ ResourceItem *item = nullptr;
item = sensor->item(RConfigWindowCoveringType);
if (item)
@@ -217,6 +219,7 @@ void DeRestPluginPrivate::handleWindowCoveringClusterIndication(const deCONZ::Ap
}
}
}
+ }
if (updated)
{
