From 9de4c2b056db06b262f70d758241cf7f2f653d20 Mon Sep 17 00:00:00 2001 From: Lewis Juggins Date: Wed, 29 Mar 2017 20:49:28 +0100 Subject: [PATCH] [switch.wemo] Fix today_energy_kwh calculation. (#6846) * [switch.wemo] Fix today_energy_kwh calculation. * Blank line fail * Round to two decimal places. --- homeassistant/components/switch/wemo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/switch/wemo.py b/homeassistant/components/switch/wemo.py index 7518a1958cf..0e40c3eff3b 100644 --- a/homeassistant/components/switch/wemo.py +++ b/homeassistant/components/switch/wemo.py @@ -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):