mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 07:37:34 +00:00
Make async_track_state_change/report_event listeners fire in order (#148766)
This commit is contained in:
parent
1fba61973d
commit
67c68dedba
@ -402,7 +402,7 @@ def _async_track_state_change_event(
|
||||
_KEYED_TRACK_STATE_REPORT = _KeyedEventTracker(
|
||||
key=_TRACK_STATE_REPORT_DATA,
|
||||
event_type=EVENT_STATE_REPORTED,
|
||||
dispatcher_callable=_async_dispatch_entity_id_event,
|
||||
dispatcher_callable=_async_dispatch_entity_id_event_soon,
|
||||
filter_callable=_async_state_filter,
|
||||
)
|
||||
|
||||
|
@ -4969,11 +4969,9 @@ async def test_async_track_state_report_change_event(hass: HomeAssistant) -> Non
|
||||
hass.states.async_set(entity_id, state)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
# The out-of-order is a result of state change listeners scheduled with
|
||||
# loop.call_soon, whereas state report listeners are called immediately.
|
||||
assert tracker_called == {
|
||||
"light.bowl": ["on", "off", "on", "off"],
|
||||
"light.top": ["on", "off", "on", "off"],
|
||||
"light.bowl": ["on", "on", "off", "off"],
|
||||
"light.top": ["on", "on", "off", "off"],
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user