Don't write storage to disk while stopping (#33456)

* Don't write storage to disk while stopping

* rework change

* lint

* remove delay save and schedule final write at stop

* update tests

* fix test component using private methods

* cleanup

* always listen

* use stop in restore state again

* whitelist JSON exceptions for later

* review comment

* make zwave tests use mock storage
This commit is contained in:
David F. Mulcahey authored and GitHub committed 2020-04-02 10:25:28 -07:00
1 parent 9fd0192441
commit 8b0a0ee521
8 files changed
+147 -34

No files matched your search

+2 -2
View File
@@ -1005,7 +1005,7 @@ async def flush_store(store):
if store._data is None:
return
store._async_cleanup_stop_listener()
store._async_cleanup_final_write_listener()
store._async_cleanup_delay_listener()
await store._async_handle_write_data()
@@ -1018,7 +1018,7 @@ async def get_system_health_info(hass, domain):
def mock_integration(hass, module):
"""Mock an integration."""
integration = loader.Integration(
hass, f"homeassistant.components.{module.DOMAIN}", None, module.mock_manifest(),
hass, f"homeassistant.components.{module.DOMAIN}", None, module.mock_manifest()
)
_LOGGER.info("Adding mock integration: %s", module.DOMAIN)