Skip to content

Commit 48ce964

Browse files
timoschillingmarkirb
authored andcommitted
tmp
1 parent 5e23328 commit 48ce964

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/shelly_switch.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ void ShellySwitch::AddPowerMeter(uint16_t *iid) {
400400
const HAPFloatCharacteristicReadRequest *, float *value) {
401401
auto energy = out_pm_->GetEnergyWH();
402402
if (!energy.ok()) return kHAPError_Busy;
403-
*value = energy.ValueOrDie();
403+
*value = energy.ValueOrDie() / 1000.0f;
404404
return kHAPError_None;
405405
},
406406
true /* supports_notification */, nullptr, "eve-total-power-consumption");
@@ -414,15 +414,15 @@ void ShellySwitch::PowerMeterTimerCB() {
414414
auto current_power = out_pm_->GetPowerW();
415415
auto current_total_power = out_pm_->GetEnergyWH();
416416

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();
419419
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();
424424
total_power_char_->RaiseEvent();
425-
}
425+
// }
426426
}
427427

428428
} // namespace shelly

0 commit comments

Comments
 (0)