diff --git a/libnymea-core/hardware/zigbee/zigbeehardwareresourceimplementation.cpp b/libnymea-core/hardware/zigbee/zigbeehardwareresourceimplementation.cpp index 46d84594..a7ef19a8 100644 --- a/libnymea-core/hardware/zigbee/zigbeehardwareresourceimplementation.cpp +++ b/libnymea-core/hardware/zigbee/zigbeehardwareresourceimplementation.cpp @@ -88,12 +88,12 @@ ZigbeeNode *ZigbeeHardwareResourceImplementation::claimNode(ZigbeeHandler *handl return nullptr; } - if (m_nodeHandlers.contains(node)) { + if (m_nodeHandlers.contains(node) && m_nodeHandlers.value(node) != handler) { qCWarning(dcZigbeeResource()) << "Node with address" << extendedAddress << "is already claimed by another handler (" << m_nodeHandlers.value(node)->name() << "). Not allowing node to be reclaimed."; return nullptr; } - m_nodeHandlers.insert(node, handler); + m_nodeHandlers[node] = handler; return node; } diff --git a/libnymea-core/nymeacore.cpp b/libnymea-core/nymeacore.cpp index 6bedb8c9..35d5f1c3 100644 --- a/libnymea-core/nymeacore.cpp +++ b/libnymea-core/nymeacore.cpp @@ -824,7 +824,7 @@ void NymeaCore::thingManagerLoaded() // Evaluate rules on current time onDateTimeChanged(m_timeManager->currentDateTime()); - // Tell zigbee we're done with loading stuff... + // Tell hardare resources we're done with loading stuff... m_hardwareManager->thingsLoaded(); emit initialized();