mirror of
https://github.com/home-assistant/core.git
synced 2025-08-13 17:45:19 +02:00
Fixed issue with edimax SP-1101 switches (#2105)
* Fixed issue with edimax SP-1101 switches * Added missing ValueError exception
This commit is contained in:
committed by
Paulus Schoutsen
parent
71452c11c1
commit
70d6ce5b79
@@ -61,6 +61,8 @@ class SmartPlugSwitch(SwitchDevice):
|
||||
return float(self.smartplug.now_power) / 1000000.0
|
||||
except ValueError:
|
||||
return None
|
||||
except TypeError:
|
||||
return None
|
||||
|
||||
@property
|
||||
def today_power_mw(self):
|
||||
@@ -69,6 +71,8 @@ class SmartPlugSwitch(SwitchDevice):
|
||||
return float(self.smartplug.now_energy_day) / 1000.0
|
||||
except ValueError:
|
||||
return None
|
||||
except TypeError:
|
||||
return None
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
|
Reference in New Issue
Block a user