[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:
Lewis Juggins 2017-03-29 20:49:28 +01:00 committed by Pascal Vizeli
parent c935bfce2a
commit 9de4c2b056

View File

@ -149,7 +149,7 @@ class WemoSwitch(SwitchDevice):
"""Today total energy usage in kWh."""
if self.insight_params:
miliwatts = convert(self.insight_params['todaymw'], float, 0.0)
return miliwatts / 1000000.0
return round(miliwatts / (1000.0 * 1000.0 * 60), 2)
@property
def detail_state(self):