Simplify timezone setting in recorder test (#116220)

This commit is contained in:
Erik Montnemery 2024-04-26 15:14:23 +02:00 committed by GitHub
parent b582d51a8a
commit 10be8f9683
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 50 additions and 91 deletions

View file

@ -1404,8 +1404,12 @@ def hass_recorder(
),
):
def setup_recorder(config: dict[str, Any] | None = None) -> HomeAssistant:
def setup_recorder(
*, config: dict[str, Any] | None = None, timezone: str | None = None
) -> HomeAssistant:
"""Set up with params."""
if timezone is not None:
hass.config.set_time_zone(timezone)
init_recorder_component(hass, config, recorder_db_url)
hass.start()
hass.block_till_done()