mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Load local calendar ics in background thread to avoid timezone I/O in event loop (#120276)
This commit is contained in:
parent
6a5c1fc613
commit
fa9bced6b0
@ -44,7 +44,9 @@ async def async_setup_entry(
|
|||||||
"""Set up the local calendar platform."""
|
"""Set up the local calendar platform."""
|
||||||
store = hass.data[DOMAIN][config_entry.entry_id]
|
store = hass.data[DOMAIN][config_entry.entry_id]
|
||||||
ics = await store.async_load()
|
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
|
calendar.prodid = PRODID
|
||||||
|
|
||||||
name = config_entry.data[CONF_CALENDAR_NAME]
|
name = config_entry.data[CONF_CALENDAR_NAME]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user