mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Improve type hints in xiaomi_aqara light turn_on (#145257)
This commit is contained in:
parent
20ce879471
commit
eb90f5a581
@ -97,7 +97,7 @@ class XiaomiGatewayLight(XiaomiDevice, LightEntity):
|
||||
"""Return the hs color value."""
|
||||
return self._hs
|
||||
|
||||
def turn_on(self, **kwargs):
|
||||
def turn_on(self, **kwargs: Any) -> None:
|
||||
"""Turn the light on."""
|
||||
if ATTR_HS_COLOR in kwargs:
|
||||
self._hs = kwargs[ATTR_HS_COLOR]
|
||||
@ -107,8 +107,8 @@ class XiaomiGatewayLight(XiaomiDevice, LightEntity):
|
||||
|
||||
rgb = color_util.color_hs_to_RGB(*self._hs)
|
||||
rgba = (self._brightness, *rgb)
|
||||
rgbhex = binascii.hexlify(struct.pack("BBBB", *rgba)).decode("ASCII")
|
||||
rgbhex = int(rgbhex, 16)
|
||||
rgbhex_str = binascii.hexlify(struct.pack("BBBB", *rgba)).decode("ASCII")
|
||||
rgbhex = int(rgbhex_str, 16)
|
||||
|
||||
if self._write_to_hub(self._sid, **{self._data_key: rgbhex}):
|
||||
self._state = True
|
||||
|
Loading…
x
Reference in New Issue
Block a user