From e30b8777f90cc0371b3d1c42170fe0604d68dd6b Mon Sep 17 00:00:00 2001 From: Pedro Ribeiro Date: Wed, 25 Sep 2024 21:30:17 +0000 Subject: [PATCH 1/2] Fix RGB --- homepilot/light.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homepilot/light.py b/homepilot/light.py index 1c2cd9e..b9d58fd 100644 --- a/homepilot/light.py +++ b/homepilot/light.py @@ -92,9 +92,9 @@ async def update_state(self, state, api): self.is_on = state["statusesMap"]["Position"] != 0 self.brightness = state["statusesMap"]["Position"] if self.has_rgb: - self.r_value: int = int(state["statusesMap"]["rgb"][2:4], 16) - self.g_value: int = int(state["statusesMap"]["rgb"][4:6], 16) - self.b_value: int = int(state["statusesMap"]["rgb"][6:8], 16) + self.r_value: int = int(state["statusesMap"]["rgb"].lower()[2:4], 16) + self.g_value: int = int(state["statusesMap"]["rgb"].lower()[4:6], 16) + self.b_value: int = int(state["statusesMap"]["rgb"].lower()[6:8], 16) self.color_temp_value = state["statusesMap"]["colortemperature"] if self.has_color_temp else 0 self.color_mode_value = state["statusesMap"]["colormode"] if self.has_color_mode else 0 @@ -176,7 +176,7 @@ async def async_set_brightness(self, new_brightness) -> None: await self.api.async_set_position(self.did, new_brightness) async def async_set_rgb(self, r, g, b) -> None: - new_rgb: str = "0x%0.6X" % (r * (2,16) + g * pow(2,8) + b) + new_rgb: str = f"0x{(r * pow(2,16) + g * pow(2,8) + b):06X}" await self.api.async_set_rgb(self.did, new_rgb) async def async_set_color_temp(self, new_color_temp) -> None: From 0252e2c7dd7b78a0ba2aadc94970823dcb7a44b5 Mon Sep 17 00:00:00 2001 From: Pedro Ribeiro Date: Wed, 25 Sep 2024 21:30:41 +0000 Subject: [PATCH 2/2] Bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fa2f9a1..47cb87f 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="pyrademacher", - version="0.14.0", + version="0.14.1", author="Pedro Ribeiro", author_email="pedroeusebio@gmail.com", description="Control devices connected to your Rademacher Homepilot "