Skip to content

Commit

Permalink
Merge pull request #393 from maxyvon/invalid_color_modes
Browse files Browse the repository at this point in the history
Update des supported color modes pour corriger le warning...
  • Loading branch information
ic-dev21 authored Mar 21, 2024
2 parents 718a509 + 7ad751b commit 038aca0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions custom_components/hilo/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,14 @@ def color_mode(self):
@property
def supported_color_modes(self) -> set:
"""Flag supported modes."""
supports = set()
supports.add(ColorMode.ONOFF)
if self._device.has_attribute("intensity"):
supports.add(ColorMode.BRIGHTNESS)
color_modes = set()
if self._device.has_attribute("hue"):
supports.add(ColorMode.HS)
return supports
color_modes.add(ColorMode.HS)
if not color_modes and self._device.has_attribute("intensity"):
color_modes.add(ColorMode.BRIGHTNESS)
if not color_modes:
color_modes.add(ColorMode.ONOFF)
return color_modes

async def async_turn_off(self, **kwargs):
LOG.info(f"{self._device._tag} Turning off")
Expand Down

0 comments on commit 038aca0

Please sign in to comment.