RFC - Add a 3rd state to the HA shutdown sequence for writing… (#33358)
* add third stage to hass shutdown * use 3rd stage in storage * update core state * add writing data to multi stop ignore * update core test * review comment * update name based on feedback
This commit is contained in:
parent
01bf4daf37
commit
bcd1eb952c
6 changed files with 27 additions and 8 deletions
|
@ -6,7 +6,7 @@ from unittest.mock import Mock, patch
|
|||
|
||||
import pytest
|
||||
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_FINAL_WRITE
|
||||
from homeassistant.helpers import storage
|
||||
from homeassistant.util import dt
|
||||
|
||||
|
@ -85,7 +85,7 @@ async def test_saving_on_stop(hass, hass_storage):
|
|||
store.async_delay_save(lambda: MOCK_DATA, 1)
|
||||
assert store.key not in hass_storage
|
||||
|
||||
hass.bus.async_fire(EVENT_HOMEASSISTANT_STOP)
|
||||
hass.bus.async_fire(EVENT_HOMEASSISTANT_FINAL_WRITE)
|
||||
await hass.async_block_till_done()
|
||||
assert hass_storage[store.key] == {
|
||||
"version": MOCK_VERSION,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue