mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Speed up restart when bluetooth adapter is in a failed state (#80640)
This commit is contained in:
parent
884f8d6e2c
commit
da14acb3b6
@ -385,14 +385,10 @@ class HaScanner(BaseHaScanner):
|
||||
|
||||
async def async_stop(self) -> None:
|
||||
"""Stop bluetooth scanner."""
|
||||
async with self._start_stop_lock:
|
||||
await self._async_stop()
|
||||
|
||||
async def _async_stop(self) -> None:
|
||||
"""Cancel watchdog and bluetooth discovery under the lock."""
|
||||
if self._cancel_watchdog:
|
||||
self._cancel_watchdog()
|
||||
self._cancel_watchdog = None
|
||||
async with self._start_stop_lock:
|
||||
await self._async_stop_scanner()
|
||||
|
||||
async def _async_stop_scanner(self) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user