From fa9bced6b0788bbdd495203f8c88c6f0fab3932f Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Sun, 23 Jun 2024 23:43:42 -0700 Subject: [PATCH] Load local calendar ics in background thread to avoid timezone I/O in event loop (#120276) --- homeassistant/components/local_calendar/calendar.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/local_calendar/calendar.py b/homeassistant/components/local_calendar/calendar.py index 213ee37ef37..66b3f80c19c 100644 --- a/homeassistant/components/local_calendar/calendar.py +++ b/homeassistant/components/local_calendar/calendar.py @@ -44,7 +44,9 @@ async def async_setup_entry( """Set up the local calendar platform.""" store = hass.data[DOMAIN][config_entry.entry_id] ics = await store.async_load() - calendar = IcsCalendarStream.calendar_from_ics(ics) + calendar: Calendar = await hass.async_add_executor_job( + IcsCalendarStream.calendar_from_ics, ics + ) calendar.prodid = PRODID name = config_entry.data[CONF_CALENDAR_NAME]