1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Ensure bluetooth can be reloaded when hot plugging a bluetooth adapter (#75699)

This commit is contained in:
J. Nick Koston
2022-07-24 19:23:23 -05:00
committed by GitHub
parent 511af3c455
commit 22ca28b93d
2 changed files with 24 additions and 1 deletions

View File

@@ -440,5 +440,11 @@ class BluetoothManager:
self._cancel_unavailable_tracking()
self._cancel_unavailable_tracking = None
if self.scanner:
await self.scanner.stop()
try:
await self.scanner.stop()
except BleakError as ex:
# This is not fatal, and they may want to reload
# the config entry to restart the scanner if they
# change the bluetooth dongle.
_LOGGER.error("Error stopping scanner: %s", ex)
uninstall_multiple_bleak_catcher()