hbldh / bleak

A cross platform Bluetooth Low Energy Client for Python using asyncio
MIT License
1.56k stars 275 forks source link

Fix _wait_removed completion on invalid object path #1544

Closed arthur-proglove closed 2 weeks ago

arthur-proglove commented 3 weeks ago

The _wait_removed method registers the "InterfacesRemoved" callback on the adapter path of the device without checking which object was removed when called. This means that any removed interface while a connection is being established can cause the _wait_removed to complete and cancel the connection.

This commit simply checks that the callback is for the proper device object path.

Fixes #1489

dlech commented 2 weeks ago

Nice one! Thanks a lot!