mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Fix for Hue not applying effect in scene (#113057)
This commit is contained in:
parent
ba971890a9
commit
0eb1adccf8
@ -235,6 +235,9 @@ class HueLight(HueBaseEntity, LightEntity):
|
|||||||
if transition is None:
|
if transition is None:
|
||||||
# a transition is required for timed effect, default to 10 minutes
|
# a transition is required for timed effect, default to 10 minutes
|
||||||
transition = 600000
|
transition = 600000
|
||||||
|
# we need to clear color values if an effect is applied
|
||||||
|
color_temp = None
|
||||||
|
xy_color = None
|
||||||
|
|
||||||
if flash is not None:
|
if flash is not None:
|
||||||
await self.async_set_flash(flash)
|
await self.async_set_flash(flash)
|
||||||
|
@ -205,6 +205,28 @@ async def test_light_turn_on_service(
|
|||||||
)
|
)
|
||||||
assert mock_bridge_v2.mock_requests[8]["json"]["timed_effects"]["duration"] == 6000
|
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(
|
async def test_light_turn_off_service(
|
||||||
hass: HomeAssistant, mock_bridge_v2, v2_resources_test_data
|
hass: HomeAssistant, mock_bridge_v2, v2_resources_test_data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user