1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Add id to automation triggers (#48464)

This commit is contained in:
Erik Montnemery
2021-03-31 14:56:04 +02:00
committed by GitHub
parent 450f3740cd
commit b26779a27a
40 changed files with 168 additions and 56 deletions

View File

@@ -45,7 +45,10 @@ async def test_if_fires_on_change_bool(hass, calls):
"platform": "template",
"value_template": '{{ states.test.entity.state == "world" and true }}',
},
"action": {"service": "test.automation"},
"action": {
"service": "test.automation",
"data_template": {"id": "{{ trigger.id}}"},
},
}
},
)
@@ -66,6 +69,7 @@ async def test_if_fires_on_change_bool(hass, calls):
hass.states.async_set("test.entity", "planet")
await hass.async_block_till_done()
assert len(calls) == 1
assert calls[0].data["id"] == 0
async def test_if_fires_on_change_str(hass, calls):