Fix trigger template entities without a unique ID (#48631)

This commit is contained in:
Paulus Schoutsen
2021-04-02 23:57:54 +00:00
parent cec80210a3
commit da31328150
2 changed files with 15 additions and 1 deletions
+13 -1
View File
@@ -1014,7 +1014,15 @@ async def test_trigger_entity(hass):
"attribute_templates": {
"plus_one": "{{ trigger.event.data.beer + 1 }}"
},
}
},
},
},
{
"trigger": [],
"sensors": {
"bare_minimum": {
"value_template": "{{ trigger.event.data.beer }}"
},
},
},
],
@@ -1027,6 +1035,10 @@ async def test_trigger_entity(hass):
assert state is not None
assert state.state == STATE_UNKNOWN
state = hass.states.get("sensor.bare_minimum")
assert state is not None
assert state.state == STATE_UNKNOWN
context = Context()
hass.bus.async_fire("test_event", {"beer": 2}, context=context)
await hass.async_block_till_done()