Fix color mode in overkiz light (#70966)

pull/70890/head
Erik Montnemery 2022-04-28 09:36:53 +02:00 committed by GitHub
parent 13d67747cb
commit 9f43fca586
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

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