diff --git a/homeassistant/components/hue/v2/light.py b/homeassistant/components/hue/v2/light.py index 9fb883d1930..b908ec83877 100644 --- a/homeassistant/components/hue/v2/light.py +++ b/homeassistant/components/hue/v2/light.py @@ -235,6 +235,9 @@ class HueLight(HueBaseEntity, LightEntity): if transition is None: # a transition is required for timed effect, default to 10 minutes transition = 600000 + # we need to clear color values if an effect is applied + color_temp = None + xy_color = None if flash is not None: await self.async_set_flash(flash) diff --git a/tests/components/hue/test_light_v2.py b/tests/components/hue/test_light_v2.py index 46d22842373..b55da314bac 100644 --- a/tests/components/hue/test_light_v2.py +++ b/tests/components/hue/test_light_v2.py @@ -205,6 +205,28 @@ async def test_light_turn_on_service( ) assert mock_bridge_v2.mock_requests[8]["json"]["timed_effects"]["duration"] == 6000 + # test enabling effect should ignore color temperature + await hass.services.async_call( + "light", + "turn_on", + {"entity_id": test_light_id, "effect": "candle", "color_temp": 500}, + blocking=True, + ) + assert len(mock_bridge_v2.mock_requests) == 10 + assert mock_bridge_v2.mock_requests[9]["json"]["effects"]["effect"] == "candle" + assert "color_temperature" not in mock_bridge_v2.mock_requests[9]["json"] + + # test enabling effect should ignore xy color + await hass.services.async_call( + "light", + "turn_on", + {"entity_id": test_light_id, "effect": "candle", "xy_color": [0.123, 0.123]}, + blocking=True, + ) + assert len(mock_bridge_v2.mock_requests) == 11 + assert mock_bridge_v2.mock_requests[10]["json"]["effects"]["effect"] == "candle" + assert "xy_color" not in mock_bridge_v2.mock_requests[9]["json"] + async def test_light_turn_off_service( hass: HomeAssistant, mock_bridge_v2, v2_resources_test_data