Don't read lights model ID and vendor name again if already known
@@ -3422,6 +3422,13 @@ bool DeRestPluginPrivate::processZclAttributes(LightNode *lightNode)
}
if (lightNode->mustRead(READ_VENDOR_NAME) && tNow > lightNode->nextReadTime(READ_VENDOR_NAME))
+ {
+ if (!lightNode->manufacturer().isEmpty())
+ {
+ lightNode->clearRead(READ_VENDOR_NAME);
+ processed++;
+ }
+ else
{
std::vector<uint16_t> attributes;
attributes.push_back(0x0004); // Manufacturer name
@@ -3432,8 +3439,16 @@ bool DeRestPluginPrivate::processZclAttributes(LightNode *lightNode)
processed++;
}
}
+ }
if ((processed < 2) && lightNode->mustRead(READ_MODEL_ID) && tNow > lightNode->nextReadTime(READ_MODEL_ID))
+ {
+ if (!lightNode->modelId().isEmpty())
+ {
+ lightNode->clearRead(READ_MODEL_ID);
+ processed++;
+ }
+ else
{
std::vector<uint16_t> attributes;
attributes.push_back(0x0005); // Model identifier
@@ -3444,6 +3459,7 @@ bool DeRestPluginPrivate::processZclAttributes(LightNode *lightNode)
processed++;
}
}
+ }
if ((processed < 2) && lightNode->mustRead(READ_SWBUILD_ID) && tNow > lightNode->nextReadTime(READ_SWBUILD_ID))
{
