Skip to content

Commit

Permalink
Merge pull request #309 from Necroneco/light-color-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
niceboygithub authored Nov 7, 2024
2 parents 37c33e0 + fd9f0d0 commit 87145e8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions custom_components/aqara_gateway/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ def __init__(
color_modes = {ColorMode.RGB}
self._attr_supported_color_modes = color_modes

if ColorMode.COLOR_TEMP in color_modes:
self._attr_color_mode = ColorMode.COLOR_TEMP
elif ColorMode.BRIGHTNESS in color_modes:
self._attr_color_mode = ColorMode.BRIGHTNESS
elif ColorMode.ONOFF in color_modes:
self._attr_color_mode = ColorMode.ONOFF
else:
self._attr_color_mode = ColorMode.UNKNOWN

@property
def is_on(self) -> bool:
"""return state """
Expand Down

0 comments on commit 87145e8

Please sign in to comment.