Fix color mode in overkiz light (#70966)

This commit is contained in:
Erik Montnemery
2022-04-28 09:36:53 +02:00
committed by GitHub
parent 13d67747cb
commit 9f43fca586

View File

@@ -48,11 +48,12 @@ class OverkizLight(OverkizEntity, LightEntity):
self._attr_supported_color_modes: set[ColorMode] = set() self._attr_supported_color_modes: set[ColorMode] = set()
if self.executor.has_command(OverkizCommand.SET_RGB): if self.executor.has_command(OverkizCommand.SET_RGB):
self._attr_supported_color_modes.add(ColorMode.RGB) self._attr_color_mode = ColorMode.RGB
if self.executor.has_command(OverkizCommand.SET_INTENSITY): elif self.executor.has_command(OverkizCommand.SET_INTENSITY):
self._attr_supported_color_modes.add(ColorMode.BRIGHTNESS) self._attr_color_mode = ColorMode.BRIGHTNESS
if not self.supported_color_modes: else:
self._attr_supported_color_modes = {ColorMode.ONOFF} self._attr_color_mode = ColorMode.ONOFF
self._attr_supported_color_modes = {self._attr_color_mode}
@property @property
def is_on(self) -> bool: def is_on(self) -> bool: