From dc672ff62cb8c51e203bbc125ec60d4d778e7bf4 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Wed, 24 Jan 2024 15:28:14 +0100 Subject: [PATCH] Fix light color mode in fritzbox (#108758) --- homeassistant/components/fritzbox/light.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/fritzbox/light.py b/homeassistant/components/fritzbox/light.py index cb0c8594695..6c06f2cc699 100644 --- a/homeassistant/components/fritzbox/light.py +++ b/homeassistant/components/fritzbox/light.py @@ -91,9 +91,13 @@ class FritzboxLight(FritzBoxDeviceEntity, LightEntity): @property def color_mode(self) -> ColorMode: """Return the color mode of the light.""" - if self.data.color_mode == COLOR_MODE: - return ColorMode.HS - return ColorMode.COLOR_TEMP + if self.data.has_color: + if self.data.color_mode == COLOR_MODE: + return ColorMode.HS + return ColorMode.COLOR_TEMP + if self.data.has_level: + return ColorMode.BRIGHTNESS + return ColorMode.ONOFF @property def supported_color_modes(self) -> set[ColorMode]: