Fix dangling task for bluetooth_le_tracker (#88284)

This commit is contained in:
Paulus Schoutsen 2023-02-17 14:57:45 -05:00 committed by GitHub
parent 91ecdc83b2
commit 710b250c1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,8 +185,9 @@ async def async_setup_scanner( # noqa: C901
and now > devs_track_battery[mac] + battery_track_interval
):
devs_track_battery[mac] = now
asyncio.create_task(
_async_see_update_ble_battery(mac, now, service_info)
hass.async_create_background_task(
_async_see_update_ble_battery(mac, now, service_info),
"bluetooth_le_tracker.device_tracker-see_update_ble_battery",
)
if track_new: