Skip to content

Commit

Permalink
Merge pull request #63 from peribeir/peribeir/issue59_1
Browse files Browse the repository at this point in the history
Peribeir/issue59 1
  • Loading branch information
peribeir authored Sep 25, 2024
2 parents cb7595f + 0252e2c commit ab7cb24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions homepilot/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pyrademacher",
version="0.14.0",
version="0.14.1",
author="Pedro Ribeiro",
author_email="[email protected]",
description="Control devices connected to your Rademacher Homepilot "
Expand Down

0 comments on commit ab7cb24

Please sign in to comment.