Renamed the SimpleMetering enum to Metering as that's what it is in the Zigbee Alliance Spec. SimpleMetering seems to come from a NXP document which isn't complete though and the upstream spec is what matters in the end. Also adds some cluster ids which are in the Zigbee spec but missing in the NXP document.
29 lines
1018 B
C++
29 lines
1018 B
C++
#include "zigbeeclusterelectricalmeasurement.h"
|
|
|
|
#include <QLoggingCategory>
|
|
Q_DECLARE_LOGGING_CATEGORY(dcZigbeeCluster)
|
|
|
|
ZigbeeClusterElectricalMeasurement::ZigbeeClusterElectricalMeasurement(ZigbeeNetwork *network, ZigbeeNode *node, ZigbeeNodeEndpoint *endpoint, Direction direction, QObject *parent):
|
|
ZigbeeCluster(network, node, endpoint, ZigbeeClusterLibrary::ClusterIdElectricalMeasurement, direction, parent)
|
|
{
|
|
|
|
}
|
|
|
|
quint16 ZigbeeClusterElectricalMeasurement::activePowerPhaseA() const
|
|
{
|
|
return m_activePowerPhaseA;
|
|
}
|
|
|
|
void ZigbeeClusterElectricalMeasurement::setAttribute(const ZigbeeClusterAttribute &attribute)
|
|
{
|
|
ZigbeeCluster::setAttribute(attribute);
|
|
|
|
switch (attribute.id()) {
|
|
case AttributeACPhaseAMeasurementActivePower:
|
|
qCDebug(dcZigbeeCluster) << "Active power changed" << attribute.dataType() << attribute.dataType().toInt16();
|
|
m_activePowerPhaseA = attribute.dataType().toInt16();
|
|
emit activePowerPhaseAChanged(m_activePowerPhaseA);
|
|
break;
|
|
}
|
|
}
|