Fix event trigger (#39884)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Paulus SchoutsenandFranck Nijhof authored and GitHub committed 2020-09-10 11:25:56 +02:00
1 parent 7b3369b71d
commit bb661ad083
2 files changed
+21 -7

No files matched your search

@@ -84,17 +84,27 @@ async def test_if_fires_on_event_with_data(hass, calls):
"trigger": {
"platform": "event",
"event_type": "test_event",
"event_data": {"some_attr": "some_value"},
"event_data": {
"some_attr": "some_value",
"second_attr": "second_value",
},
},
"action": {"service": "test.automation"},
}
},
)
hass.bus.async_fire("test_event", {"some_attr": "some_value", "another": "value"})
hass.bus.async_fire(
"test_event",
{"some_attr": "some_value", "another": "value", "second_attr": "second_value"},
)
await hass.async_block_till_done()
assert len(calls) == 1
hass.bus.async_fire("test_event", {"some_attr": "some_value", "another": "value"})
await hass.async_block_till_done()
assert len(calls) == 1 # No new call
async def test_if_fires_on_event_with_empty_data_config(hass, calls):
"""Test the firing of events with empty data config.