Merge branch 'zigbee-hardware-resource' of github.com:guh/nymea into zigbee-hardware-resource

This commit is contained in:
Simon Stürz 2020-11-12 11:42:04 +01:00
commit 685948f8c8
3 changed files with 9 additions and 1 deletions

View File

@ -161,6 +161,11 @@ void ZigbeeHardwareResourceImplementation::onZigbeeNodeAdded(const QUuid &networ
void ZigbeeHardwareResourceImplementation::onZigbeeNodeRemoved(const QUuid &networkUuid, ZigbeeNode *node)
{
qCDebug(dcZigbeeResource()) << node << "left the network" << m_zigbeeManager->zigbeeNetworks().value(networkUuid);
foreach (ZigbeeHandler *tmp, m_handlers) {
tmp->handleRemoveNode(node, networkUuid);
}
}
}

View File

@ -393,6 +393,7 @@ void ZigbeeManager::addNetwork(ZigbeeNetwork *network)
// ZigbeeNodeInitializer *nodeInitializer = m_zigbeeNodeInitializers.value(network->networkUuid());
// nodeInitializer->initializeNode(node);
// TODO: emit node added once initialized so the plugins can use it
emit nodeAdded(network->networkUuid(), node);
});

View File

@ -2,8 +2,9 @@
#define ZIGBEEHANDLER_H
#include "zigbeenode.h"
#include "libnymea.h"
class ZigbeeHandler
class LIBNYMEA_EXPORT ZigbeeHandler
{
public:
ZigbeeHandler();
@ -11,6 +12,7 @@ public:
virtual QString name() const = 0;
virtual bool handleNode(ZigbeeNode *node, const QUuid &networkUuid) = 0;
virtual void handleRemoveNode(ZigbeeNode *node, const QUuid &networkUuid) = 0;
};
#endif // ZIGBEEHANDLER_H