Skip to content

Commit

Permalink
detect automatic switching to auto effect
Browse files Browse the repository at this point in the history
  • Loading branch information
kongo09 committed Oct 31, 2024
1 parent d6ba5e4 commit e3ca9b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions custom_components/philips_airpurifier_coap/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ def brightness(self) -> int | None:

brightness = int(self._device_status.get(self.kind))

# maybe the light has auto capability and medium capability and the brightness indicates auto, but the effect is not set yet
if self._auto and self._medium and brightness == int(self._auto):
self._attr_effect = SWITCH_AUTO
return None

# if the light has medium capability, and the brightness is set to medium
if self._medium and brightness == int(self._medium):
return 128
Expand Down

0 comments on commit e3ca9b4

Please sign in to comment.