From 9f43fca5862f31f3f819911a7db72175dc89402a Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 28 Apr 2022 09:36:53 +0200 Subject: [PATCH] Fix color mode in overkiz light (#70966) --- homeassistant/components/overkiz/light.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/overkiz/light.py b/homeassistant/components/overkiz/light.py index 0ad6cb0d9c5..bb06b645d24 100644 --- a/homeassistant/components/overkiz/light.py +++ b/homeassistant/components/overkiz/light.py @@ -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: