From 9de4f1485bc291de87ac8f707bc79b40b4b53841 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 16 Nov 2020 23:42:24 +0100 Subject: [PATCH] Add thermostat settings attributes --- .../zcl/hvac/zigbeeclusterthermostat.h | 19 +++++++++++++++- libnymea-zigbee/zigbeenodeendpoint.cpp | 22 +++++-------------- libnymea-zigbee/zigbeenodeendpoint.h | 2 ++ 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/libnymea-zigbee/zcl/hvac/zigbeeclusterthermostat.h b/libnymea-zigbee/zcl/hvac/zigbeeclusterthermostat.h index c3b481a..903076a 100644 --- a/libnymea-zigbee/zcl/hvac/zigbeeclusterthermostat.h +++ b/libnymea-zigbee/zcl/hvac/zigbeeclusterthermostat.h @@ -49,7 +49,24 @@ public: AttributeAbsMaxCoolSetpointLimit = 0x0006, AttributePICoolingDemand = 0x0007, AttributePIHeatingDemand = 0x0008, - AttributeHVACSystemTypeConfiguration = 0x0009 + AttributeHVACSystemTypeConfiguration = 0x0009, + + AttributeLocalTemperatureCalibratioon = 0x0010, + AttributeOccupiedCoolingSetpoint = 0x0011, + AttributeOccupiedHeatingSetpoint = 0x0012, + AttributeUnoccupiedCoolingSetpoint = 0x0013, + AttributeUnoccupiedHeatingSetpoint = 0x0014, + AttributeMinHeatSetpointLimit = 0x0015, + AttributeMaxHeatSetpointLimit = 0x0016, + AttributeMinCoolSetpointLimit = 0x0017, + AttributeMaxCoolSetpointLimit = 0x0018, + AttributeMinSetpointDeadBand = 0x0019, + AttributeRemoteSensing = 0x001a, + AttributeControlSequenceOfOperation = 0x001b, + AttributeSystemMode = 0x001c, + AttributeAlarmMask = 0x001d, + AttributeThermostatRunningMode = 0x001e + }; Q_ENUM(Attribute) diff --git a/libnymea-zigbee/zigbeenodeendpoint.cpp b/libnymea-zigbee/zigbeenodeendpoint.cpp index 87516fa..e610b19 100644 --- a/libnymea-zigbee/zigbeenodeendpoint.cpp +++ b/libnymea-zigbee/zigbeenodeendpoint.cpp @@ -102,7 +102,7 @@ ZigbeeCluster *ZigbeeNodeEndpoint::getInputCluster(ZigbeeClusterLibrary::Cluster bool ZigbeeNodeEndpoint::hasInputCluster(ZigbeeClusterLibrary::ClusterId clusterId) const { - return m_inputClusters.keys().contains(clusterId); + return m_inputClusters.contains(clusterId); } QList ZigbeeNodeEndpoint::outputClusters() const @@ -117,7 +117,7 @@ ZigbeeCluster *ZigbeeNodeEndpoint::getOutputCluster(ZigbeeClusterLibrary::Cluste bool ZigbeeNodeEndpoint::hasOutputCluster(ZigbeeClusterLibrary::ClusterId clusterId) const { - return m_outputClusters.keys().contains(clusterId); + return m_outputClusters.contains(clusterId); } ZigbeeNodeEndpoint::ZigbeeNodeEndpoint(ZigbeeNetwork *network, ZigbeeNode *node, quint8 endpointId, QObject *parent) : @@ -167,56 +167,46 @@ ZigbeeCluster *ZigbeeNodeEndpoint::createCluster(ZigbeeClusterLibrary::ClusterId // General case ZigbeeClusterLibrary::ClusterIdBasic: return new ZigbeeClusterBasic(m_network, m_node, this, direction, this); - break; case ZigbeeClusterLibrary::ClusterIdPowerConfiguration: return new ZigbeeClusterPowerConfiguration(m_network, m_node, this, direction, this); - break; case ZigbeeClusterLibrary::ClusterIdIdentify: return new ZigbeeClusterIdentify(m_network, m_node, this, direction, this); - break; case ZigbeeClusterLibrary::ClusterIdOnOff: return new ZigbeeClusterOnOff(m_network, m_node, this, direction, this); - break; case ZigbeeClusterLibrary::ClusterIdLevelControl: return new ZigbeeClusterLevelControl(m_network, m_node, this, direction, this); - break; // Measurement case ZigbeeClusterLibrary::ClusterIdIlluminanceMeasurement: return new ZigbeeClusterIlluminanceMeasurment(m_network, m_node, this, direction, this); - break; case ZigbeeClusterLibrary::ClusterIdTemperatureMeasurement: return new ZigbeeClusterTemperatureMeasurement(m_network, m_node, this, direction, this); - break; case ZigbeeClusterLibrary::ClusterIdRelativeHumidityMeasurement: return new ZigbeeClusterRelativeHumidityMeasurement(m_network, m_node, this, direction, this); - break; case ZigbeeClusterLibrary::ClusterIdOccupancySensing: return new ZigbeeClusterOccupancySensing(m_network, m_node, this, direction, this); - break; case ZigbeeClusterLibrary::ClusterIdPressureMeasurement: return new ZigbeeClusterPressureMeasurement(m_network, m_node, this, direction, this); - break; // Colsures case ZigbeeClusterLibrary::ClusterIdDoorLock: return new ZigbeeClusterDoorLock(m_network, m_node, this, direction, this); - break; // Lighting case ZigbeeClusterLibrary::ClusterIdColorControl: return new ZigbeeClusterColorControl(m_network, m_node, this, direction, this); - break; // Security case ZigbeeClusterLibrary::ClusterIdIasZone: return new ZigbeeClusterIasZone(m_network, m_node, this, direction, this); - break; // OTA case ZigbeeClusterLibrary::ClusterIdOtaUpgrade: return new ZigbeeClusterOta(m_network, m_node, this, direction, this); - break; + + // HVAC + case ZigbeeClusterLibrary::ClusterIdThermostat: + return new ZigbeeClusterThermostat(m_network, m_node, this, direction, this); default: // Return a default cluster since we have no special implementation for this cluster, allowing to use generic clusters operations diff --git a/libnymea-zigbee/zigbeenodeendpoint.h b/libnymea-zigbee/zigbeenodeendpoint.h index 4937876..4e64da5 100644 --- a/libnymea-zigbee/zigbeenodeendpoint.h +++ b/libnymea-zigbee/zigbeenodeendpoint.h @@ -57,6 +57,8 @@ #include "zcl/ota/zigbeeclusterota.h" +#include "zcl/hvac/zigbeeclusterthermostat.h" + class ZigbeeNode; class ZigbeeNetwork;