Reload notify platforms concurrently with asyncio.gather (#39384)

pull/39386/head
J. Nick Koston 2020-08-29 15:23:57 -05:00 committed by GitHub
parent 22a123fd4b
commit 54ef16f01a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -66,8 +66,11 @@ async def async_reload(hass, integration_name):
):
return
for data in hass.data[NOTIFY_SERVICES][integration_name]:
await _async_setup_notify_services(hass, data)
tasks = [
_async_setup_notify_services(hass, data)
for data in hass.data[NOTIFY_SERVICES][integration_name]
]
await asyncio.gather(*tasks)
async def _async_setup_notify_services(hass, data):