Fix deprecated asyncio.wait use with coroutines (#94371)
This commit is contained in:
parent
fd43687833
commit
2d62735b0d
3 changed files with 7 additions and 5 deletions
|
@ -275,9 +275,7 @@ async def async_setup_entry(
|
|||
if not entity_method:
|
||||
continue
|
||||
await entity_method(**params)
|
||||
update_tasks.append(
|
||||
hass.async_create_task(entity.async_update_ha_state(True))
|
||||
)
|
||||
update_tasks.append(asyncio.create_task(entity.async_update_ha_state(True)))
|
||||
|
||||
if update_tasks:
|
||||
await asyncio.wait(update_tasks)
|
||||
|
|
|
@ -229,7 +229,9 @@ async def async_setup_entry(
|
|||
if not hasattr(target_device, method["method"]):
|
||||
continue
|
||||
await getattr(target_device, method["method"])(**params)
|
||||
update_tasks.append(target_device.async_update_ha_state(True))
|
||||
update_tasks.append(
|
||||
asyncio.create_task(target_device.async_update_ha_state(True))
|
||||
)
|
||||
|
||||
if update_tasks:
|
||||
await asyncio.wait(update_tasks)
|
||||
|
|
|
@ -500,7 +500,9 @@ async def async_setup_other_entry(hass, config_entry, async_add_entities):
|
|||
if not hasattr(device, method["method"]):
|
||||
continue
|
||||
await getattr(device, method["method"])(**params)
|
||||
update_tasks.append(device.async_update_ha_state(True))
|
||||
update_tasks.append(
|
||||
asyncio.create_task(device.async_update_ha_state(True))
|
||||
)
|
||||
|
||||
if update_tasks:
|
||||
await asyncio.wait(update_tasks)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue