Skip to content

Commit

Permalink
Implemented color_mode property as well
Browse files Browse the repository at this point in the history
  • Loading branch information
c503ghosh committed Mar 23, 2024
1 parent d42f80f commit 906ad91
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion custom_components/dirigera_platform/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ def set_state(self):
elif cap == "colorHue" or cap == "colorSaturation":
color_modes.append(ColorMode.HS)

self._supported_color_modes = color_modes
if len(color_modes) == 0:
self._supported_color_modes = ColorMode.UNKNOWN
else:
self._supported_color_modes = color_modes
logger.debug("supported color mode set to ")
logger.debug(self._supported_color_modes)

Expand Down Expand Up @@ -131,6 +134,10 @@ def is_on(self):
def supported_color_modes(self):
return self._supported_color_modes

@property
def color_mode(self):
return self._supported_color_modes

def update(self):
try:
self._json_data = self._hub.get_light_by_id(self._json_data.id)
Expand Down

0 comments on commit 906ad91

Please sign in to comment.