From 527989fe7c30fd71f2154515748c324c0d700d4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 19 Nov 2020 14:37:44 +0100 Subject: [PATCH] Ignore the coordinator node in the zigbee resource --- .../zigbee/zigbeehardwareresourceimplementation.cpp | 8 ++++++++ libnymea-core/zigbee/zigbeemanager.cpp | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/libnymea-core/hardware/zigbee/zigbeehardwareresourceimplementation.cpp b/libnymea-core/hardware/zigbee/zigbeehardwareresourceimplementation.cpp index a7ef19a8..f7efd46b 100644 --- a/libnymea-core/hardware/zigbee/zigbeehardwareresourceimplementation.cpp +++ b/libnymea-core/hardware/zigbee/zigbeehardwareresourceimplementation.cpp @@ -169,6 +169,10 @@ void ZigbeeHardwareResourceImplementation::thingsLoaded() foreach (ZigbeeNetwork *network, m_zigbeeManager->zigbeeNetworks()) { if (network->state() == ZigbeeNetwork::StateRunning) { foreach (ZigbeeNode *node, network->nodes()) { + // Ignore the coordinator node + if (node->shortAddress() == 0x0000) + continue; + if (!m_nodeHandlers.contains(node)) { qCDebug(dcZigbeeResource()) << "Node" << node << "is not yet handled by any plugin. Trying to find a suitable plugin."; onZigbeeNodeAdded(network->networkUuid(), node); @@ -199,6 +203,10 @@ void ZigbeeHardwareResourceImplementation::onZigbeeNetworkChanged(ZigbeeNetwork // been installed now, such nodes might be handled by them now. if (network->state() == ZigbeeNetwork::StateRunning && m_thingsLoaded) { foreach (ZigbeeNode *node, network->nodes()) { + // Ignore the coordinator node + if (node->shortAddress() == 0x0000) + continue; + if (!m_nodeHandlers.contains(node)) { onZigbeeNodeAdded(network->networkUuid(), node); } diff --git a/libnymea-core/zigbee/zigbeemanager.cpp b/libnymea-core/zigbee/zigbeemanager.cpp index 42c3ac43..374f7a35 100644 --- a/libnymea-core/zigbee/zigbeemanager.cpp +++ b/libnymea-core/zigbee/zigbeemanager.cpp @@ -299,6 +299,17 @@ void ZigbeeManager::loadZigbeeNetworks() void ZigbeeManager::checkPlatformConfiguration() { + /* Example platform configurations + * + * serialPort=/dev/ttymxc2 + * baudRate=115200 + * backend=nxp + * + * serialPort=/dev/ttyS0 + * baudRate=38400 + * backend=deconz + */ + QFileInfo platformConfigurationFileInfo(NymeaSettings::settingsPath() + QDir::separator() + "zigbee-platform.conf"); if (platformConfigurationFileInfo.exists()) { qCDebug(dcZigbee()) << "Found zigbee platform configuration" << platformConfigurationFileInfo.absoluteFilePath();