Update IAS Zone cluster

This commit is contained in:
Simon Stürz 2020-12-15 16:43:56 +01:00
parent 108898053e
commit 1dd3406120
2 changed files with 7 additions and 4 deletions

View File

@ -49,7 +49,7 @@ ZigbeeClusterIasZone::ZoneType ZigbeeClusterIasZone::zoneType() const
return m_zoneType; return m_zoneType;
} }
ZigbeeClusterIasZone::ZoneStatus ZigbeeClusterIasZone::zoneStatus() const ZigbeeClusterIasZone::ZoneStatusFlags ZigbeeClusterIasZone::zoneStatus() const
{ {
return m_zoneStatus; return m_zoneStatus;
} }
@ -62,12 +62,15 @@ void ZigbeeClusterIasZone::setAttribute(const ZigbeeClusterAttribute &attribute)
if (attribute.id() == AttributeZoneState) { if (attribute.id() == AttributeZoneState) {
quint8 zoneStateInt = attribute.dataType().toUInt8(); quint8 zoneStateInt = attribute.dataType().toUInt8();
m_zoneState = static_cast<ZoneState>(zoneStateInt); m_zoneState = static_cast<ZoneState>(zoneStateInt);
qCDebug(dcZigbeeCluster()) << m_node << m_endpoint << m_zoneState;
} else if (attribute.id() == AttributeZoneType) { } else if (attribute.id() == AttributeZoneType) {
quint16 zoneTypeInt = attribute.dataType().toUInt16(); quint16 zoneTypeInt = attribute.dataType().toUInt16();
m_zoneType = static_cast<ZoneType>(zoneTypeInt); m_zoneType = static_cast<ZoneType>(zoneTypeInt);
qCDebug(dcZigbeeCluster()) << m_node << m_endpoint << m_zoneType;
} else if (attribute.id() == AttributeZoneStatus) { } else if (attribute.id() == AttributeZoneStatus) {
quint16 zoneStatusInt = attribute.dataType().toUInt16(); quint16 zoneStatusInt = attribute.dataType().toUInt16();
m_zoneStatus = ZoneStatus(zoneStatusInt); m_zoneStatus = ZoneStatusFlags(zoneStatusInt);
qCDebug(dcZigbeeCluster()) << m_node << m_endpoint << m_zoneStatus;
} }
} }

View File

@ -125,12 +125,12 @@ public:
ZoneState zoneState() const; ZoneState zoneState() const;
ZoneType zoneType() const; ZoneType zoneType() const;
ZoneStatus zoneStatus() const; ZoneStatusFlags zoneStatus() const;
private: private:
ZoneState m_zoneState = ZoneStateNotEnrolled; ZoneState m_zoneState = ZoneStateNotEnrolled;
ZoneType m_zoneType = ZoneTypeInvalidZone; ZoneType m_zoneType = ZoneTypeInvalidZone;
ZoneStatus m_zoneStatus; ZoneStatusFlags m_zoneStatus;
void setAttribute(const ZigbeeClusterAttribute &attribute) override; void setAttribute(const ZigbeeClusterAttribute &attribute) override;