mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Edimax component reports wrong power values (#13011)
* Fixed Edimax switch authentication error for newer firmware. * pyedimax moved to pypi * Added pyedimax to gen_requirements_all.py * Cleanup * Fixed https://github.com/home-assistant/home-assistant/issues/13008 * Only ValueError now * Trivial error.
This commit is contained in:
parent
92f13ff60d
commit
1d2fd8a2e9
@ -83,14 +83,13 @@ class SmartPlugSwitch(SwitchDevice):
|
||||
def update(self):
|
||||
"""Update edimax switch."""
|
||||
try:
|
||||
self._now_power = float(self.smartplug.now_power) / 1000000.0
|
||||
except (TypeError, ValueError):
|
||||
self._now_power = float(self.smartplug.now_power)
|
||||
except ValueError:
|
||||
self._now_power = None
|
||||
|
||||
try:
|
||||
self._now_energy_day = (float(self.smartplug.now_energy_day) /
|
||||
1000.0)
|
||||
except (TypeError, ValueError):
|
||||
self._now_energy_day = float(self.smartplug.now_energy_day)
|
||||
except ValueError:
|
||||
self._now_energy_day = None
|
||||
|
||||
self._state = self.smartplug.state == 'ON'
|
||||
|
Loading…
x
Reference in New Issue
Block a user