Pass tasks instead of coros to asyncio.wait in forked_daapd (#78462)
* Remove coroutines from asyncio.wait in forked_daapd * Update homeassistant/components/forked_daapd/media_player.py Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
This commit is contained in:
parent
219cee2ca9
commit
855b0dfdba
1 changed files with 7 additions and 5 deletions
|
@ -418,13 +418,15 @@ class ForkedDaapdMaster(MediaPlayerEntity):
|
|||
# restore state
|
||||
await self._api.set_volume(volume=self._last_volume * 100)
|
||||
if self._last_outputs:
|
||||
futures = []
|
||||
futures: list[asyncio.Task[int]] = []
|
||||
for output in self._last_outputs:
|
||||
futures.append(
|
||||
self._api.change_output(
|
||||
output["id"],
|
||||
selected=output["selected"],
|
||||
volume=output["volume"],
|
||||
asyncio.create_task(
|
||||
self._api.change_output(
|
||||
output["id"],
|
||||
selected=output["selected"],
|
||||
volume=output["volume"],
|
||||
)
|
||||
)
|
||||
)
|
||||
await asyncio.wait(futures)
|
||||
|
|
Loading…
Add table
Reference in a new issue