Migrate start helper to use run_immediately (#115055)

This commit is contained in:
J. Nick Koston 2024-04-06 12:35:46 -10:00 committed by GitHub
parent 3ef2c464ac
commit c4b5a7c027
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 6 deletions

View File

@ -47,9 +47,7 @@ def _async_at_core_state(
if unsub:
unsub()
unsub = hass.bus.async_listen_once(
event_type, _matched_event, run_immediately=False
)
unsub = hass.bus.async_listen_once(event_type, _matched_event, run_immediately=True)
return cancel

View File

@ -1206,7 +1206,7 @@ async def test_delta_values(
await hass.async_block_till_done()
state = hass.states.get("sensor.energy_bill")
assert state.attributes.get("status") == PAUSED
assert state.attributes.get("status") == COLLECTING
now += timedelta(seconds=30)
with freeze_time(now):
@ -1249,7 +1249,7 @@ async def test_delta_values(
state = hass.states.get("sensor.energy_bill")
assert state is not None
assert state.state == "9"
assert state.state == "10"
@pytest.mark.parametrize(
@ -1316,7 +1316,7 @@ async def test_non_periodically_resetting(
await hass.async_block_till_done()
state = hass.states.get("sensor.energy_bill")
assert state.attributes.get("status") == PAUSED
assert state.attributes.get("status") == COLLECTING
now += timedelta(seconds=30)
with freeze_time(now):