switch.tplink, light.tplink: bump the pyhs100 version and adapt to api changes (#9454)
* bump the pyhs100 version and fix api changes * switch.tplink: avoid I/O during __init__ * initialize _name to None in __init__ * update requirements_all.txt for the new version
This commit is contained in:
1 parent
e89e64263c
commit
e19e9a1f2b
3 files changed
+11
-15
No files matched your search
@@ -17,7 +17,7 @@ from homeassistant.util.color import (
|
||||
|
||||
from typing import Tuple
|
||||
|
||||
REQUIREMENTS = ['pyHS100==0.2.4.2']
|
||||
REQUIREMENTS = ['pyHS100==0.3.0']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -124,7 +124,7 @@ class TPLinkSmartBulb(Light):
|
||||
|
||||
def update(self):
|
||||
"""Update the TP-Link Bulb's state."""
|
||||
from pyHS100 import SmartPlugException
|
||||
from pyHS100 import SmartDeviceException
|
||||
try:
|
||||
self._state = (
|
||||
self.smartbulb.state == self.smartbulb.BULB_STATE_ON)
|
||||
@@ -136,7 +136,7 @@ class TPLinkSmartBulb(Light):
|
||||
self._color_temp = kelvin_to_mired(
|
||||
self.smartbulb.color_temp)
|
||||
self._rgb = hsv_to_rgb(self.smartbulb.hsv)
|
||||
except (SmartPlugException, OSError) as ex:
|
||||
except (SmartDeviceException, OSError) as ex:
|
||||
_LOGGER.warning('Could not read state for %s: %s', self.name, ex)
|
||||
|
||||
@property
|
||||
|
||||
Reference in new issue
Block a user