Fix loop in add sensors
@@ -2488,11 +2488,13 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node)
switch (ci->id())
{
case BASIC_CLUSTER_ID:
+ {
+ if (modelId.isEmpty() || manufacturer.isEmpty())
{
std::vector<deCONZ::ZclAttribute>::const_iterator i = ci->attributes().begin();
std::vector<deCONZ::ZclAttribute>::const_iterator end = ci->attributes().end();
- if (modelId.isEmpty() || manufacturer.isEmpty())
+ for (; i != end; ++i)
{
if (i->id() == 0x0004) // model id
{
@@ -2503,6 +2505,7 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node)
modelId = i->toString().trimmed();
}
}
+ }
fpSwitch.inClusters.push_back(ci->id());
if (node->nodeDescriptor().manufacturerCode() == VENDOR_PHILIPS)
