From eb90f5a5812af345a7d1d6df57872d3591c92ada Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 20 May 2025 00:11:34 +0200 Subject: [PATCH] Improve type hints in xiaomi_aqara light turn_on (#145257) --- homeassistant/components/xiaomi_aqara/light.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/xiaomi_aqara/light.py b/homeassistant/components/xiaomi_aqara/light.py index ef1f06695f9..b19719dc5dc 100644 --- a/homeassistant/components/xiaomi_aqara/light.py +++ b/homeassistant/components/xiaomi_aqara/light.py @@ -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