mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Fix bluetooth tracker asyncio usage (#94695)
* fix for asyncio usage fixes the error "Passing coroutines is forbidden, use tasks explicitly", caused by passing an async function into asyncio.wait directly instead of creating a task for it. * removes unnecessary default param * corrects formatting for black
This commit is contained in:
parent
45bf1235d8
commit
3440c1615d
@ -173,7 +173,11 @@ async def async_setup_scanner(
|
||||
rssi = await hass.async_add_executor_job(client.request_rssi)
|
||||
client.close()
|
||||
|
||||
tasks.append(see_device(hass, async_see, mac, friendly_name, rssi))
|
||||
tasks.append(
|
||||
asyncio.create_task(
|
||||
see_device(hass, async_see, mac, friendly_name, rssi)
|
||||
)
|
||||
)
|
||||
|
||||
if tasks:
|
||||
await asyncio.wait(tasks)
|
||||
|
Loading…
x
Reference in New Issue
Block a user