1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-08 17:49:37 +01:00

Fix blocking I/O in the event loop when loading timezones (#117721)

This commit is contained in:
J. Nick Koston
2024-05-19 23:06:03 -10:00
committed by GitHub
parent 0293315b23
commit 5a609c34bb
98 changed files with 294 additions and 217 deletions
+13
View File
@@ -3502,3 +3502,16 @@ async def test_thread_safety_message(hass: HomeAssistant) -> None:
),
):
await hass.async_add_executor_job(hass.verify_event_loop_thread, "test")
async def test_set_time_zone_deprecated(hass: HomeAssistant) -> None:
"""Test set_time_zone is deprecated."""
with pytest.raises(
RuntimeError,
match=re.escape(
"Detected code that set the time zone using set_time_zone instead of "
"async_set_time_zone which will stop working in Home Assistant 2025.6. "
"Please report this issue.",
),
):
await hass.config.set_time_zone("America/New_York")