mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Fix deprecated asyncio.wait use with coroutines (#94371)
This commit is contained in:
parent
fd43687833
commit
2d62735b0d
@ -275,9 +275,7 @@ async def async_setup_entry(
|
|||||||
if not entity_method:
|
if not entity_method:
|
||||||
continue
|
continue
|
||||||
await entity_method(**params)
|
await entity_method(**params)
|
||||||
update_tasks.append(
|
update_tasks.append(asyncio.create_task(entity.async_update_ha_state(True)))
|
||||||
hass.async_create_task(entity.async_update_ha_state(True))
|
|
||||||
)
|
|
||||||
|
|
||||||
if update_tasks:
|
if update_tasks:
|
||||||
await asyncio.wait(update_tasks)
|
await asyncio.wait(update_tasks)
|
||||||
|
@ -229,7 +229,9 @@ async def async_setup_entry(
|
|||||||
if not hasattr(target_device, method["method"]):
|
if not hasattr(target_device, method["method"]):
|
||||||
continue
|
continue
|
||||||
await getattr(target_device, method["method"])(**params)
|
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:
|
if update_tasks:
|
||||||
await asyncio.wait(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"]):
|
if not hasattr(device, method["method"]):
|
||||||
continue
|
continue
|
||||||
await getattr(device, method["method"])(**params)
|
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:
|
if update_tasks:
|
||||||
await asyncio.wait(update_tasks)
|
await asyncio.wait(update_tasks)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user