Skip to content

Commit

Permalink
Add color mode for AmcrestRingLight
Browse files Browse the repository at this point in the history
  • Loading branch information
rroller committed Jun 9, 2024
1 parent 788318a commit 9c459d1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions custom_components/dahua/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,16 @@ async def async_turn_off(self, **kwargs):
await self._coordinator.client.async_set_light_global_enabled(False)
await self._coordinator.async_refresh()

@property
def color_mode(self) -> ColorMode | str | None:
"""Return the color mode of the light."""
return ColorMode.ONOFF

@property
def supported_color_modes(self) -> set[str]:
"""Flag supported color modes."""
return {self.color_mode}


class FloodLight(DahuaBaseEntity, LightEntity):
"""
Expand Down Expand Up @@ -336,3 +346,13 @@ async def async_turn_off(self, **kwargs):
def icon(self):
"""Return the icon of this switch."""
return SECURITY_LIGHT_ICON

@property
def color_mode(self) -> ColorMode | str | None:
"""Return the color mode of the light."""
return ColorMode.ONOFF

@property
def supported_color_modes(self) -> set[str]:
"""Flag supported color modes."""
return {self.color_mode}

0 comments on commit 9c459d1

Please sign in to comment.