DEV: Refactor APS indication
@@ -974,8 +974,11 @@ void DeRestPluginPrivate::apsdeDataIndicationDevice(const deCONZ::ApsDataIndicat
{
ResourceItem *item = r->itemForIndex(i);
DBG_Assert(item);
- if (item && item->ddfItemHandle() != DeviceDescription::Item::InvalidItemHandle)
+ if (!item)
{
+ continue;
+ }
+
ParseFunction_t parseFunction = item->parseFunction();
const auto &ddfItem = DDF_GetItem(item);
@@ -986,7 +989,16 @@ void DeRestPluginPrivate::apsdeDataIndicationDevice(const deCONZ::ApsDataIndicat
parseFunction = DA_GetParseFunction(ddfItem.parseParameters);
}
- if (parseFunction && parseFunction(r, item, ind, zclFrame, ddfItem.parseParameters))
+ if (!parseFunction)
+ {
+ if (!ddfItem.parseParameters.isNull())
+ {
+ DBG_Printf(DBG_INFO, "parse function for %s not found: %s\n", item->descriptor().suffix, qPrintable(ddfItem.parseParameters.toString()));
+ }
+ continue;
+ }
+
+ if (parseFunction(r, item, ind, zclFrame, ddfItem.parseParameters))
{
if (item->awake())
{
@@ -1007,11 +1019,6 @@ void DeRestPluginPrivate::apsdeDataIndicationDevice(const deCONZ::ApsDataIndicat
DB_StoreSubDeviceItem(r, item);
}
}
- else if (!parseFunction)
- {
- DBG_Printf(DBG_INFO, "parse function not found: %s\n", qPrintable(ddfItem.parseParameters.toString()));
- }
- }
}
}
