mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix hue fallback onoff colormode (#109856)
Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
This commit is contained in:
parent
d9f97bc7ec
commit
b420c65016
@ -94,6 +94,9 @@ class HueLight(HueBaseEntity, LightEntity):
|
|||||||
self._supported_color_modes.add(ColorMode.BRIGHTNESS)
|
self._supported_color_modes.add(ColorMode.BRIGHTNESS)
|
||||||
# support transition if brightness control
|
# support transition if brightness control
|
||||||
self._attr_supported_features |= LightEntityFeature.TRANSITION
|
self._attr_supported_features |= LightEntityFeature.TRANSITION
|
||||||
|
if len(self._supported_color_modes) == 0:
|
||||||
|
# only add onoff colormode as fallback
|
||||||
|
self._supported_color_modes.add(ColorMode.ONOFF)
|
||||||
self._last_brightness: float | None = None
|
self._last_brightness: float | None = None
|
||||||
self._color_temp_active: bool = False
|
self._color_temp_active: bool = False
|
||||||
# get list of supported effects (combine effects and timed_effects)
|
# get list of supported effects (combine effects and timed_effects)
|
||||||
|
@ -72,7 +72,7 @@ async def test_lights(
|
|||||||
assert light_4.attributes["friendly_name"] == "Hue on/off light"
|
assert light_4.attributes["friendly_name"] == "Hue on/off light"
|
||||||
assert light_4.state == "off"
|
assert light_4.state == "off"
|
||||||
assert light_4.attributes["mode"] == "normal"
|
assert light_4.attributes["mode"] == "normal"
|
||||||
assert light_4.attributes["supported_color_modes"] == []
|
assert light_4.attributes["supported_color_modes"] == [ColorMode.ONOFF]
|
||||||
|
|
||||||
|
|
||||||
async def test_light_turn_on_service(
|
async def test_light_turn_on_service(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user