diff --git a/code/espurna/sensors/BaseSensor.h b/code/espurna/sensors/BaseSensor.h index b1f8cd79..ed81adcb 100644 --- a/code/espurna/sensors/BaseSensor.h +++ b/code/espurna/sensors/BaseSensor.h @@ -95,8 +95,7 @@ class BaseSensor { switch (type(index)) { case MAGNITUDE_TEMPERATURE: return sensor::Unit::Celcius; - case MAGNITUDE_HUMIDITY: - case MAGNITUDE_POWER_FACTOR: + case MAGNITUDE_HUMIDITY: return sensor::Unit::Percentage; case MAGNITUDE_PRESSURE: return sensor::Unit::Hectopascal; diff --git a/code/espurna/sensors/PZEM004TV30Sensor.h b/code/espurna/sensors/PZEM004TV30Sensor.h index d13cb485..62f0a71b 100644 --- a/code/espurna/sensors/PZEM004TV30Sensor.h +++ b/code/espurna/sensors/PZEM004TV30Sensor.h @@ -402,7 +402,7 @@ class PZEM004TV30Sensor : public BaseEmonSensor { // - Power Factor: 2 bytes in 0.1% (we return %) _power_factor = take_2(); - _power_factor /= 10.0; + _power_factor /= 100.0; // - Alarms: 2 bytes, (NOT IMPLEMENTED) // XXX: it seems it can only be either 0xffff or 0 for ON and OFF respectively