diff --git a/homeassistant/components/bluetooth/manifest.json b/homeassistant/components/bluetooth/manifest.json index 3c926db79d4..4ca4add7fc3 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.12.0", - "bluetooth-auto-recovery==0.5.5", + "bluetooth-auto-recovery==1.0.0", "bluetooth-data-tools==0.3.0", "dbus-fast==1.75.0" ], diff --git a/homeassistant/components/bluetooth/scanner.py b/homeassistant/components/bluetooth/scanner.py index 09032715c74..d56c3f76c4c 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.mode = mode @@ -375,7 +376,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 c2336dd7af0..e3f44daff2b 100644 --- a/homeassistant/components/bluetooth/util.py +++ b/homeassistant/components/bluetooth/util.py @@ -36,9 +36,9 @@ def async_load_history_from_system( } -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 6e8f3a511dd..05767d91dc0 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.12.0 -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 802db40dfd5..bf5b8630216 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -450,7 +450,7 @@ bluemaestro-ble==0.2.0 bluetooth-adapters==0.12.0 # 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 0fd60298193..6699e7b536d 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -364,7 +364,7 @@ bluemaestro-ble==0.2.0 bluetooth-adapters==0.12.0 # homeassistant.components.bluetooth -bluetooth-auto-recovery==0.5.5 +bluetooth-auto-recovery==1.0.0 # homeassistant.components.bluetooth # homeassistant.components.led_ble