DEV: Add workaround to forward device name to core
+#include "de_web_plugin.h"
#include "de_web_plugin_private.h"
/*! Inits the event queue.
@@ -39,6 +40,21 @@ void DeRestPluginPrivate::eventQueueTimerFired()
if (device)
{
device->handleEvent(e);
+
+ }
+
+ // hack to forward first sub device name to core to show it as node name
+ if (device && e.what() == REventDDFInitResponse && e.num() > 0)
+ {
+ const auto subDevices = device->subDevices();
+ if (!subDevices.empty())
+ {
+ const auto *i = subDevices.front()->item(RAttrName);
+ if (i && !i->toString().isEmpty())
+ {
+ emit q_ptr->nodeUpdated(e.deviceKey(), QLatin1String("name"), i->toString());
+ }
+ }
}
}
