diff --git a/custom_components/somneo/light.py b/custom_components/somneo/light.py index 2fa9259..9e60815 100644 --- a/custom_components/somneo/light.py +++ b/custom_components/somneo/light.py @@ -44,9 +44,14 @@ class SomneoLight(SomneoEntity, LightEntity): """Representation of an Somneo Light.""" _attr_should_poll = True - _attr_supported_color_modes = ColorMode.BRIGHTNESS + _attr_supported_color_modes: set[ColorMode| str] = {ColorMode.BRIGHTNESS} _attr_translation_key = "normal_light" + @property + def color_mode(self) -> ColorMode: + """Return the color mode of the light.""" + return ColorMode.BRIGHTNESS + @callback def _handle_coordinator_update(self) -> None: self._attr_is_on = self.coordinator.data["light_is_on"] @@ -66,8 +71,14 @@ class SomneoNightLight(SomneoEntity, LightEntity): """Representation of an Somneo Night light.""" _attr_should_poll = True + _attr_supported_color_modes: set[ColorMode| str] = {ColorMode.ONOFF} _attr_translation_key = "night_light" + @property + def color_mode(self) -> ColorMode: + """Return the color mode of the light.""" + return ColorMode.ONOFF + @callback def _handle_coordinator_update(self) -> None: self._attr_is_on = self.coordinator.data["nightlight_is_on"]