mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Start homekit bridges with asyncio.gather (#42498)
This commit is contained in:
parent
3c8c5a814b
commit
2858a90d5c
@ -355,6 +355,7 @@ def _async_register_events_and_services(hass: HomeAssistant):
|
|||||||
|
|
||||||
async def async_handle_homekit_service_start(service):
|
async def async_handle_homekit_service_start(service):
|
||||||
"""Handle start HomeKit service call."""
|
"""Handle start HomeKit service call."""
|
||||||
|
tasks = []
|
||||||
for entry_id in hass.data[DOMAIN]:
|
for entry_id in hass.data[DOMAIN]:
|
||||||
if HOMEKIT not in hass.data[DOMAIN][entry_id]:
|
if HOMEKIT not in hass.data[DOMAIN][entry_id]:
|
||||||
continue
|
continue
|
||||||
@ -368,7 +369,8 @@ def _async_register_events_and_services(hass: HomeAssistant):
|
|||||||
"been stopped"
|
"been stopped"
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
await homekit.async_start()
|
tasks.append(homekit.async_start())
|
||||||
|
await asyncio.gather(*tasks)
|
||||||
|
|
||||||
hass.services.async_register(
|
hass.services.async_register(
|
||||||
DOMAIN, SERVICE_HOMEKIT_START, async_handle_homekit_service_start
|
DOMAIN, SERVICE_HOMEKIT_START, async_handle_homekit_service_start
|
||||||
|
Loading…
x
Reference in New Issue
Block a user