diff --git a/homeassistant/components/bluetooth/manifest.json b/homeassistant/components/bluetooth/manifest.json index 95098549dee..6baed5d7817 100644 --- a/homeassistant/components/bluetooth/manifest.json +++ b/homeassistant/components/bluetooth/manifest.json @@ -9,7 +9,7 @@ "bleak==0.19.2", "bleak-retry-connector==2.10.1", "bluetooth-adapters==0.14.1", - "bluetooth-auto-recovery==0.5.5", + "bluetooth-auto-recovery==1.0.0", "bluetooth-data-tools==0.3.0", "dbus-fast==1.82.0" ], diff --git a/homeassistant/components/bluetooth/scanner.py b/homeassistant/components/bluetooth/scanner.py index 40a938ae9e6..55a33af976a 100644 --- a/homeassistant/components/bluetooth/scanner.py +++ b/homeassistant/components/bluetooth/scanner.py @@ -130,6 +130,7 @@ class HaScanner(BaseHaScanner): new_info_callback: Callable[[BluetoothServiceInfoBleak], None], ) -> None: """Init bluetooth discovery.""" + self.mac_address = address source = address if address != DEFAULT_ADDRESS else adapter or SOURCE_LOCAL super().__init__(hass, source, adapter) self.connectable = True @@ -372,7 +373,7 @@ class HaScanner(BaseHaScanner): # so we log at debug level. If we later come up with a repair # strategy, we will change this to raise a repair issue as well. _LOGGER.debug("%s: adapter stopped responding; executing reset", self.name) - result = await async_reset_adapter(self.adapter) + result = await async_reset_adapter(self.adapter, self.mac_address) _LOGGER.debug("%s: adapter reset result: %s", self.name, result) async def async_stop(self) -> None: diff --git a/homeassistant/components/bluetooth/util.py b/homeassistant/components/bluetooth/util.py index a7ae2e7daca..5419fa79e1c 100644 --- a/homeassistant/components/bluetooth/util.py +++ b/homeassistant/components/bluetooth/util.py @@ -68,9 +68,9 @@ def async_load_history_from_system( return all_loaded_history, connectable_loaded_history -async def async_reset_adapter(adapter: str | None) -> bool | None: +async def async_reset_adapter(adapter: str | None, mac_address: str) -> bool | None: """Reset the adapter.""" if adapter and adapter.startswith("hci"): adapter_id = int(adapter[3:]) - return await recover_adapter(adapter_id) + return await recover_adapter(adapter_id, mac_address) return False diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 319573eac9e..53e5a94345e 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -13,7 +13,7 @@ bcrypt==3.1.7 bleak-retry-connector==2.10.1 bleak==0.19.2 bluetooth-adapters==0.14.1 -bluetooth-auto-recovery==0.5.5 +bluetooth-auto-recovery==1.0.0 bluetooth-data-tools==0.3.0 certifi>=2021.5.30 ciso8601==2.2.0 diff --git a/requirements_all.txt b/requirements_all.txt index f8d8d625ee8..b18c9685270 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -453,7 +453,7 @@ bluemaestro-ble==0.2.0 bluetooth-adapters==0.14.1 # homeassistant.components.bluetooth -bluetooth-auto-recovery==0.5.5 +bluetooth-auto-recovery==1.0.0 # homeassistant.components.bluetooth # homeassistant.components.led_ble diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 1694332b34e..8c8d17edf3a 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -367,7 +367,7 @@ bluemaestro-ble==0.2.0 bluetooth-adapters==0.14.1 # homeassistant.components.bluetooth -bluetooth-auto-recovery==0.5.5 +bluetooth-auto-recovery==1.0.0 # homeassistant.components.bluetooth # homeassistant.components.led_ble