-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race with _disconnect_monitor event in BlueZ (#999)
If the device disconnects right away for any reason, the on_connected_changed callback fires and clears the disconnect_monitor_event which results in the following exception: ``` File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 182, in connect asyncio.ensure_future(self._disconnect_monitor()) File "/usr/local/lib/python3.10/asyncio/tasks.py", line 615, in ensure_future return _ensure_future(coro_or_future, loop=loop) File "/usr/local/lib/python3.10/asyncio/tasks.py", line 636, in _ensure_future return loop.create_task(coro_or_future) Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 240, in _disconnect_monitor await self._disconnect_monitor_event.wait() AttributeError: NoneType object has no attribute wait ```
- Loading branch information
Showing
2 changed files
with
13 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters