diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c0917c6e..7ee36cb8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -25,6 +25,7 @@ Fixed * Fixed BlueZ version in passive scanning error message. Fixes #1433. * Fixed mypy requiring ``Unpack[ExtraArgs]`` that were intended to be optional. Fixes #1487. * Fixed ``KeyError`` in BlueZ ``is_connected()`` and ``get_global_bluez_manager()`` when device is not present. Fixes #1507. +* Fixed BlueZ _wait_removed completion on invalid object path. Fixes #1489. `0.21.1`_ (2023-09-08) ====================== diff --git a/bleak/backends/bluezdbus/manager.py b/bleak/backends/bluezdbus/manager.py index 282b2160..ad905395 100644 --- a/bleak/backends/bluezdbus/manager.py +++ b/bleak/backends/bluezdbus/manager.py @@ -853,8 +853,9 @@ async def _wait_removed(self, device_path: str) -> None: event = asyncio.Event() - def callback(_: str): - event.set() + def callback(o: str) -> None: + if o == device_path: + event.set() device_removed_callback_and_state = DeviceRemovedCallbackAndState( callback, self._properties[device_path][defs.DEVICE_INTERFACE]["Adapter"] diff --git a/pyproject.toml b/pyproject.toml index 673f46a9..43028a06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "bleak-proglove" -version = "0.21.1" +version = "0.21.1-2" description = "Bluetooth Low Energy platform Agnostic Klient" authors = ["Henrik Blidh "] license = "MIT"