Skip to content

Commit 9c459d1

Browse files
committed
Add color mode for AmcrestRingLight
#355
1 parent 788318a commit 9c459d1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

custom_components/dahua/light.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,16 @@ async def async_turn_off(self, **kwargs):
216216
await self._coordinator.client.async_set_light_global_enabled(False)
217217
await self._coordinator.async_refresh()
218218

219+
@property
220+
def color_mode(self) -> ColorMode | str | None:
221+
"""Return the color mode of the light."""
222+
return ColorMode.ONOFF
223+
224+
@property
225+
def supported_color_modes(self) -> set[str]:
226+
"""Flag supported color modes."""
227+
return {self.color_mode}
228+
219229

220230
class FloodLight(DahuaBaseEntity, LightEntity):
221231
"""
@@ -336,3 +346,13 @@ async def async_turn_off(self, **kwargs):
336346
def icon(self):
337347
"""Return the icon of this switch."""
338348
return SECURITY_LIGHT_ICON
349+
350+
@property
351+
def color_mode(self) -> ColorMode | str | None:
352+
"""Return the color mode of the light."""
353+
return ColorMode.ONOFF
354+
355+
@property
356+
def supported_color_modes(self) -> set[str]:
357+
"""Flag supported color modes."""
358+
return {self.color_mode}

0 commit comments

Comments
 (0)