From dde4217b2b4c1601770de9226080dc0bc4360b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A5le=20Stor=C3=B8=20Hauknes?= Date: Wed, 3 Jan 2024 21:08:58 +0100 Subject: [PATCH] Close stale connections (Airthings BLE) (#106748) Co-authored-by: J. Nick Koston --- homeassistant/components/airthings_ble/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/airthings_ble/__init__.py b/homeassistant/components/airthings_ble/__init__.py index c642ebf95635..1d62442f14de 100644 --- a/homeassistant/components/airthings_ble/__init__.py +++ b/homeassistant/components/airthings_ble/__init__.py @@ -5,6 +5,7 @@ from datetime import timedelta import logging from airthings_ble import AirthingsBluetoothDeviceData, AirthingsDevice +from bleak_retry_connector import close_stale_connections_by_address from homeassistant.components import bluetooth from homeassistant.config_entries import ConfigEntry @@ -30,6 +31,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: is_metric = hass.config.units is METRIC_SYSTEM assert address is not None + await close_stale_connections_by_address(address) + ble_device = bluetooth.async_ble_device_from_address(hass, address) if not ble_device: