Skip to content

Commit

Permalink
set color_mode for lights
Browse files Browse the repository at this point in the history
  • Loading branch information
caibinqing committed Nov 3, 2024
1 parent 264b887 commit fd9f0d0
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 fd9f0d0

Please sign in to comment.