@@ -400,7 +400,7 @@ void ShellySwitch::AddPowerMeter(uint16_t *iid) {
400
400
const HAPFloatCharacteristicReadRequest *, float *value) {
401
401
auto energy = out_pm_->GetEnergyWH ();
402
402
if (!energy.ok ()) return kHAPError_Busy ;
403
- *value = energy.ValueOrDie ();
403
+ *value = energy.ValueOrDie () / 1000 . 0f ;
404
404
return kHAPError_None ;
405
405
},
406
406
true /* supports_notification */ , nullptr , " eve-total-power-consumption" );
@@ -414,15 +414,15 @@ void ShellySwitch::PowerMeterTimerCB() {
414
414
auto current_power = out_pm_->GetPowerW ();
415
415
auto current_total_power = out_pm_->GetEnergyWH ();
416
416
417
- if (current_power.ok () && current_power.ValueOrDie () != last_power_) {
418
- last_power_ = current_power.ValueOrDie ();
417
+ // if (current_power.ok() && current_power.ValueOrDie() != last_power_) {
418
+ // last_power_ = current_power.ValueOrDie();
419
419
power_char_->RaiseEvent ();
420
- }
421
- if (current_total_power.ok () &&
422
- current_total_power.ValueOrDie () != last_total_power_) {
423
- last_total_power_ = current_total_power.ValueOrDie ();
420
+ // }
421
+ // if (current_total_power.ok() &&
422
+ // current_total_power.ValueOrDie() != last_total_power_) {
423
+ // last_total_power_ = current_total_power.ValueOrDie();
424
424
total_power_char_->RaiseEvent ();
425
- }
425
+ // }
426
426
}
427
427
428
428
} // namespace shelly
0 commit comments