1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-26 22:18:40 +00:00

Restore typeerror check for units sans energy tracking (#13824)

This commit is contained in:
Josh Anderson
2018-04-15 15:25:30 +02:00
committed by Fabian Affolter
parent cd8935cbd2
commit c69f37500a

View File

@@ -84,12 +84,12 @@ class SmartPlugSwitch(SwitchDevice):
"""Update edimax switch."""
try:
self._now_power = float(self.smartplug.now_power)
except ValueError:
except (TypeError, ValueError):
self._now_power = None
try:
self._now_energy_day = float(self.smartplug.now_energy_day)
except ValueError:
except (TypeError, ValueError):
self._now_energy_day = None
self._state = self.smartplug.state == 'ON'