Skip to content

Commit

Permalink
fix light
Browse files Browse the repository at this point in the history
  • Loading branch information
kongo09 committed Jan 8, 2024
1 parent c2fd2b4 commit 5d37ccc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions custom_components/philips_airpurifier_coap/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,6 @@ class PhilipsApi:
"IAI": ("Indoor Allergen Index", ICON.IAI),
"PM2.5": ("PM2.5", ICON.PM25),
}
DISPLAY_BACKLIGHT_MAP = {
"0": False,
"1": True,
}
FUNCTION_MAP = {
"P": ("Purification", ICON.PURIFICATION_ONLY_MODE),
"PH": ("Purification and Humidification", ICON.TWO_IN_ONE_MODE),
Expand Down
4 changes: 2 additions & 2 deletions custom_components/philips_airpurifier_coap/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ def __init__( # noqa: D107
@property
def is_on(self) -> bool:
"""Return if the light is on."""
status = self._device_status.get(self.kind)
status = int(self._device_status.get(self.kind))
# _LOGGER.debug("is_on, kind: %s - status: %s - on: %s", self.kind, status, self._on)
if self._dimmable:
return status > 0
else:
return status == self._on
return status == int(self._on)

@property
def brightness(self) -> int | None:
Expand Down

0 comments on commit 5d37ccc

Please sign in to comment.