From 3440c1615d15265e1a0256c6e2873af407e68eda Mon Sep 17 00:00:00 2001 From: Dirk Sarodnick Date: Fri, 16 Jun 2023 04:10:04 +0200 Subject: [PATCH] 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 --- .../components/bluetooth_tracker/device_tracker.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/bluetooth_tracker/device_tracker.py b/homeassistant/components/bluetooth_tracker/device_tracker.py index 659243df733..f4fc6a8df08 100644 --- a/homeassistant/components/bluetooth_tracker/device_tracker.py +++ b/homeassistant/components/bluetooth_tracker/device_tracker.py @@ -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)