Load mailbox integration platforms in tracked tasks (#114774)

This commit is contained in:
J. Nick Koston 2024-04-03 11:12:38 -10:00 committed by GitHub
parent e86fec310b
commit 5394a2a34a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -110,14 +110,11 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
component.register_shutdown()
await component.async_add_entities([mailbox_entity])
setup_tasks = [
asyncio.create_task(async_setup_platform(p_type, p_config))
for p_type, p_config in config_per_platform(config, DOMAIN)
if p_type is not None
]
if setup_tasks:
await asyncio.wait(setup_tasks)
for p_type, p_config in config_per_platform(config, DOMAIN):
if p_type is not None:
hass.async_create_task(
async_setup_platform(p_type, p_config), eager_start=True
)
async def async_platform_discovered(
platform: str, info: DiscoveryInfoType | None