mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix runtime error in CalDAV (#104800)
This commit is contained in:
parent
1ab9357840
commit
68e883dc63
@ -11,7 +11,11 @@ async def async_get_calendars(
|
|||||||
hass: HomeAssistant, client: caldav.DAVClient, component: str
|
hass: HomeAssistant, client: caldav.DAVClient, component: str
|
||||||
) -> list[caldav.Calendar]:
|
) -> list[caldav.Calendar]:
|
||||||
"""Get all calendars that support the specified component."""
|
"""Get all calendars that support the specified component."""
|
||||||
calendars = await hass.async_add_executor_job(client.principal().calendars)
|
|
||||||
|
def _get_calendars() -> list[caldav.Calendar]:
|
||||||
|
return client.principal().calendars()
|
||||||
|
|
||||||
|
calendars = await hass.async_add_executor_job(_get_calendars)
|
||||||
components_results = await asyncio.gather(
|
components_results = await asyncio.gather(
|
||||||
*[
|
*[
|
||||||
hass.async_add_executor_job(calendar.get_supported_components)
|
hass.async_add_executor_job(calendar.get_supported_components)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user