mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Explicitly create_task for asyncio.wait (#46325)
This commit is contained in:
parent
cf69415272
commit
9f4874bb81
@ -181,7 +181,10 @@ async def async_setup(hass, config):
|
|||||||
return
|
return
|
||||||
|
|
||||||
await asyncio.wait(
|
await asyncio.wait(
|
||||||
[script_entity.async_turn_off() for script_entity in script_entities]
|
[
|
||||||
|
asyncio.create_task(script_entity.async_turn_off())
|
||||||
|
for script_entity in script_entities
|
||||||
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
async def toggle_service(service):
|
async def toggle_service(service):
|
||||||
|
@ -629,7 +629,7 @@ async def entity_service_call(
|
|||||||
# Context expires if the turn on commands took a long time.
|
# Context expires if the turn on commands took a long time.
|
||||||
# Set context again so it's there when we update
|
# Set context again so it's there when we update
|
||||||
entity.async_set_context(call.context)
|
entity.async_set_context(call.context)
|
||||||
tasks.append(entity.async_update_ha_state(True))
|
tasks.append(asyncio.create_task(entity.async_update_ha_state(True)))
|
||||||
|
|
||||||
if tasks:
|
if tasks:
|
||||||
done, pending = await asyncio.wait(tasks)
|
done, pending = await asyncio.wait(tasks)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user