diff --git a/homeassistant/components/bluetooth/const.py b/homeassistant/components/bluetooth/const.py index 8b0a8ae149c..6d6751f6ac4 100644 --- a/homeassistant/components/bluetooth/const.py +++ b/homeassistant/components/bluetooth/const.py @@ -72,6 +72,3 @@ ADAPTER_ADDRESS: Final = "address" ADAPTER_SW_VERSION: Final = "sw_version" ADAPTER_HW_VERSION: Final = "hw_version" ADAPTER_PASSIVE_SCAN: Final = "passive_scan" - - -NO_RSSI_VALUE: Final = -127 diff --git a/homeassistant/components/bluetooth/manager.py b/homeassistant/components/bluetooth/manager.py index abdf73f0659..b38f6005b50 100644 --- a/homeassistant/components/bluetooth/manager.py +++ b/homeassistant/components/bluetooth/manager.py @@ -11,6 +11,7 @@ import time from typing import TYPE_CHECKING, Any, Final from bleak.backends.scanner import AdvertisementDataCallback +from bleak_retry_connector import NO_RSSI_VALUE, RSSI_SWITCH_THRESHOLD from homeassistant import config_entries from homeassistant.core import ( @@ -27,7 +28,6 @@ from .const import ( ADAPTER_ADDRESS, ADAPTER_PASSIVE_SCAN, FALLBACK_MAXIMUM_STALE_ADVERTISEMENT_SECONDS, - NO_RSSI_VALUE, UNAVAILABLE_TRACK_SECONDS, AdapterDetails, ) @@ -67,8 +67,6 @@ APPLE_START_BYTES_WANTED: Final = { APPLE_DEVICE_ID_START_BYTE, } -RSSI_SWITCH_THRESHOLD = 6 - MONOTONIC_TIME: Final = time.monotonic _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/bluetooth/manifest.json b/homeassistant/components/bluetooth/manifest.json index ef6157706bc..c11256a3657 100644 --- a/homeassistant/components/bluetooth/manifest.json +++ b/homeassistant/components/bluetooth/manifest.json @@ -7,7 +7,7 @@ "quality_scale": "internal", "requirements": [ "bleak==0.19.0", - "bleak-retry-connector==2.3.0", + "bleak-retry-connector==2.3.1", "bluetooth-adapters==0.6.0", "bluetooth-auto-recovery==0.3.4", "dbus-fast==1.45.0" diff --git a/homeassistant/components/bluetooth/models.py b/homeassistant/components/bluetooth/models.py index 1256cd7697a..99024dd3450 100644 --- a/homeassistant/components/bluetooth/models.py +++ b/homeassistant/components/bluetooth/models.py @@ -18,14 +18,12 @@ from bleak.backends.scanner import ( AdvertisementDataCallback, BaseBleakScanner, ) -from bleak_retry_connector import freshen_ble_device +from bleak_retry_connector import NO_RSSI_VALUE, freshen_ble_device from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback as hass_callback from homeassistant.helpers.frame import report from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo -from .const import NO_RSSI_VALUE - if TYPE_CHECKING: from .manager import BluetoothManager diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index ee70296bd4a..a88d6918303 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -10,7 +10,7 @@ atomicwrites-homeassistant==1.4.1 attrs==21.2.0 awesomeversion==22.9.0 bcrypt==3.1.7 -bleak-retry-connector==2.3.0 +bleak-retry-connector==2.3.1 bleak==0.19.0 bluetooth-adapters==0.6.0 bluetooth-auto-recovery==0.3.4 diff --git a/requirements_all.txt b/requirements_all.txt index 1e066c596de..d263dbd73a9 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -413,7 +413,7 @@ bimmer_connected==0.10.4 bizkaibus==0.1.1 # homeassistant.components.bluetooth -bleak-retry-connector==2.3.0 +bleak-retry-connector==2.3.1 # homeassistant.components.bluetooth bleak==0.19.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index d5756c5db92..f0dd9e54cf9 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -337,7 +337,7 @@ bellows==0.34.2 bimmer_connected==0.10.4 # homeassistant.components.bluetooth -bleak-retry-connector==2.3.0 +bleak-retry-connector==2.3.1 # homeassistant.components.bluetooth bleak==0.19.0