Fix light color mode in fritzbox (#108758)

pull/108735/head
Erik Montnemery 2024-01-24 15:28:14 +01:00 committed by GitHub
parent fcf72ae0c2
commit dc672ff62c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 3 deletions

View File

@ -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]: