1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Update sensor recorder tests to async (#124061)

This commit is contained in:
Erik Montnemery
2024-08-18 20:20:58 +02:00
committed by GitHub
parent 7d5ddbf51c
commit ce2ffde22e
5 changed files with 54 additions and 38 deletions

View File

@@ -251,6 +251,7 @@ async def async_test_home_assistant(
event_loop: asyncio.AbstractEventLoop | None = None,
load_registries: bool = True,
config_dir: str | None = None,
initial_state: CoreState = CoreState.running,
) -> AsyncGenerator[HomeAssistant]:
"""Return a Home Assistant object pointing at test config dir."""
hass = HomeAssistant(config_dir or get_test_config_dir())
@@ -378,7 +379,7 @@ async def async_test_home_assistant(
await rs.async_load(hass)
hass.data[bootstrap.DATA_REGISTRIES_LOADED] = None
hass.set_state(CoreState.running)
hass.set_state(initial_state)
@callback
def clear_instance(event):