Load local calendar ics in background thread to avoid timezone I/O in event loop (#120276)

This commit is contained in:
Allen Porter 2024-06-23 23:43:42 -07:00 committed by GitHub
parent 6a5c1fc613
commit fa9bced6b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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]