Merge PR #401: ZigbeeLumi: Fix pressure for Lumi sensors

This commit is contained in:
Jenkins nymea 2021-02-26 10:28:14 +01:00
commit 9ceee2b047

View File

@ -404,11 +404,11 @@ void IntegrationPluginZigbeeLumi::setupThing(ThingSetupInfo *info)
if (pressureCluster) { if (pressureCluster) {
// Only set the state if the cluster actually has the attribute // Only set the state if the cluster actually has the attribute
if (pressureCluster->hasAttribute(ZigbeeClusterPressureMeasurement::AttributeMeasuredValue)) { if (pressureCluster->hasAttribute(ZigbeeClusterPressureMeasurement::AttributeMeasuredValue)) {
thing->setStateValue(lumiWeatherSensorPressureStateTypeId, pressureCluster->pressure() * 101); thing->setStateValue(lumiWeatherSensorPressureStateTypeId, pressureCluster->pressure() * 10);
} }
connect(pressureCluster, &ZigbeeClusterPressureMeasurement::pressureChanged, thing, [thing](double pressure){ connect(pressureCluster, &ZigbeeClusterPressureMeasurement::pressureChanged, thing, [thing](double pressure){
thing->setStateValue(lumiWeatherSensorPressureStateTypeId, pressure * 101); thing->setStateValue(lumiWeatherSensorPressureStateTypeId, pressure * 10);
}); });
} else { } else {
qCWarning(dcZigbeeLumi()) << "Could not find the pressure measurement server cluster on" << thing << endpoint; qCWarning(dcZigbeeLumi()) << "Could not find the pressure measurement server cluster on" << thing << endpoint;