Add transition support to scenes, cleanup blocking parameter (#34434)
This commit is contained in:
1 parent
19be31d13a
commit
bc5a2da7b7
66 files changed
+547
-229
No files matched your search
@@ -58,6 +58,24 @@ async def test_apply_service(hass):
|
||||
assert state.state == "on"
|
||||
assert state.attributes["brightness"] == 50
|
||||
|
||||
turn_on_calls = async_mock_service(hass, "light", "turn_on")
|
||||
assert await hass.services.async_call(
|
||||
"scene",
|
||||
"apply",
|
||||
{
|
||||
"transition": 42,
|
||||
"entities": {"light.bed_light": {"state": "on", "brightness": 50}},
|
||||
},
|
||||
blocking=True,
|
||||
)
|
||||
|
||||
assert len(turn_on_calls) == 1
|
||||
assert turn_on_calls[0].domain == "light"
|
||||
assert turn_on_calls[0].service == "turn_on"
|
||||
assert turn_on_calls[0].data.get("transition") == 42
|
||||
assert turn_on_calls[0].data.get("entity_id") == "light.bed_light"
|
||||
assert turn_on_calls[0].data.get("brightness") == 50
|
||||
|
||||
|
||||
async def test_create_service(hass, caplog):
|
||||
"""Test the create service."""
|
||||
|
||||
Reference in new issue
Block a user