@@ -44,11 +44,14 @@ def __init__(
44
44
) -> None :
45
45
self ._instance = lednetwfinstance
46
46
self ._entry_id = entry_id
47
+ # 2025.3 ColorMode.BRIGHTNESS should not be specified with other combination of supported color modes, as it will throw an error, but is is supported
48
+ # when lights are rendering an effect automatically
49
+ # https://developers.home-assistant.io/docs/core/entity/light/#color-modes
47
50
if self ._instance ._model == RING_LIGHT_MODEL :
48
- self ._attr_supported_color_modes = {ColorMode .BRIGHTNESS , ColorMode . COLOR_TEMP , ColorMode .HS }
51
+ self ._attr_supported_color_modes = {ColorMode .COLOR_TEMP , ColorMode .HS }
49
52
self ._color_temp_kelvin : self ._instance ._color_temp_kelvin
50
53
else :
51
- self ._attr_supported_color_modes = {ColorMode .BRIGHTNESS , ColorMode . RGB }
54
+ self ._attr_supported_color_modes = {ColorMode .RGB }
52
55
self ._attr_supported_features = LightEntityFeature .EFFECT
53
56
self ._attr_name = name
54
57
self ._attr_unique_id = self ._instance .mac
@@ -218,7 +221,14 @@ def light_local_callback(self):
218
221
def update_ha_state (self ) -> None :
219
222
LOGGER .debug ("update_ha_state called" )
220
223
if self .hs_color is None and self .color_temp_kelvin is None and self .rgb_color is None :
221
- self ._color_mode = ColorMode .BRIGHTNESS #2024.2 We can use brightness color mode so even when we don't know the state of the light the brightness can be controlled
224
+ if self ._instance ._effect is not None and self ._instance ._effect is not EFFECT_OFF :
225
+ self ._color_mode = ColorMode .BRIGHTNESS
226
+ #2024.2 We can use brightness color mode so even when we don't know the state of the light the brightness can be controlled
227
+ #2025.3 ColorMode.BRIGHTNESS is not considered a valid supported color when on standalone, this gets ignored when
228
+ #light is rendering an effect
229
+ else :
230
+ self ._color_mode = ColorMode .UNKNOWN
231
+ #2025.3 When not sure of color mode ColorMode.UNKNOWN avoids throwing errors on unsupported combination of color modes
222
232
elif self .hs_color is not None :
223
233
self ._color_mode = ColorMode .HS
224
234
elif self .rgb_color is not None :
0 commit comments