Store only changes for lights if zcl value data store is enabled
Polling would otherwise store lots of data without much changes.
@@ -2146,9 +2146,9 @@ LightNode *DeRestPluginPrivate::updateLightNode(const deCONZ::NodeEvent &event)
Event e(RLights, RStateBri, lightNode->id(), item);
enqueueEvent(e);
updated = true;
+ pushZclValueDb(event.node()->address().ext(), event.endpoint(), event.clusterId(), ia->id(), ia->numericValue().u8);
}
lightNode->setZclValue(updateType, event.clusterId(), 0x0000, ia->numericValue());
- pushZclValueDb(event.node()->address().ext(), event.endpoint(), event.clusterId(), ia->id(), ia->numericValue().u8);
break;
}
}
@@ -2175,6 +2175,7 @@ LightNode *DeRestPluginPrivate::updateLightNode(const deCONZ::NodeEvent &event)
Event e(RLights, RStateOn, lightNode->id(), item);
enqueueEvent(e);
updated = true;
+ pushZclValueDb(event.node()->address().ext(), event.endpoint(), event.clusterId(), ia->id(), ia->numericValue().u8);
}
else
{
@@ -2189,7 +2190,6 @@ LightNode *DeRestPluginPrivate::updateLightNode(const deCONZ::NodeEvent &event)
}
}
lightNode->setZclValue(updateType, event.clusterId(), 0x0000, ia->numericValue());
- pushZclValueDb(event.node()->address().ext(), event.endpoint(), event.clusterId(), ia->id(), ia->numericValue().u8);
break;
}
}
@@ -2283,6 +2283,7 @@ LightNode *DeRestPluginPrivate::updateLightNode(const deCONZ::NodeEvent &event)
Event e(RLights, RStateBri, lightNode->id(), item);
enqueueEvent(e);
updated = true;
+ pushZclValueDb(event.node()->address().ext(), event.endpoint(), event.clusterId(), ia->id(), ia->numericValue().real);
}
bool on = level > 0;
item = lightNode->item(RStateOn);
@@ -2295,7 +2296,6 @@ LightNode *DeRestPluginPrivate::updateLightNode(const deCONZ::NodeEvent &event)
updated = true;
}
lightNode->setZclValue(updateType, event.clusterId(), 0x0055, ia->numericValue());
- pushZclValueDb(event.node()->address().ext(), event.endpoint(), event.clusterId(), ia->id(), ia->numericValue().real);
break;
}
}
