Make homekit_controller platform load tasks eagerly (#111701)

pull/111704/head
J. Nick Koston 2024-02-27 21:46:42 -10:00 committed by GitHub
parent e0d15680a6
commit c3412bb017
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -30,6 +30,7 @@ from homeassistant.helpers import device_registry as dr, entity_registry as er
from homeassistant.helpers.debounce import Debouncer from homeassistant.helpers.debounce import Debouncer
from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.event import async_call_later, async_track_time_interval from homeassistant.helpers.event import async_call_later, async_track_time_interval
from homeassistant.util.async_ import create_eager_task
from .config_flow import normalize_hkid from .config_flow import normalize_hkid
from .const import ( from .const import (
@ -822,7 +823,10 @@ class HKDevice:
if to_load: if to_load:
await asyncio.gather( await asyncio.gather(
*[self.async_load_platform(platform) for platform in to_load] *(
create_eager_task(self.async_load_platform(platform))
for platform in to_load
)
) )
@callback @callback