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:
committed by
Fabian Affolter
parent
cd8935cbd2
commit
c69f37500a
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user