mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
[switch.wemo] Fix today_energy_kwh calculation. (#6846)
* [switch.wemo] Fix today_energy_kwh calculation. * Blank line fail * Round to two decimal places.
This commit is contained in:
parent
c935bfce2a
commit
9de4c2b056
@ -149,7 +149,7 @@ class WemoSwitch(SwitchDevice):
|
|||||||
"""Today total energy usage in kWh."""
|
"""Today total energy usage in kWh."""
|
||||||
if self.insight_params:
|
if self.insight_params:
|
||||||
miliwatts = convert(self.insight_params['todaymw'], float, 0.0)
|
miliwatts = convert(self.insight_params['todaymw'], float, 0.0)
|
||||||
return miliwatts / 1000000.0
|
return round(miliwatts / (1000.0 * 1000.0 * 60), 2)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def detail_state(self):
|
def detail_state(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user