backends/bluez: don't disconnect devices we did not connect#1984
Open
Vodur wants to merge 1 commit into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1984 +/- ##
===========================================
+ Coverage 52.45% 52.72% +0.27%
===========================================
Files 43 43
Lines 4097 4106 +9
Branches 504 506 +2
===========================================
+ Hits 2149 2165 +16
+ Misses 1817 1813 -4
+ Partials 131 128 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
faea97f to
75708ed
Compare
dlech
reviewed
May 9, 2026
3c1a7c6 to
37b4549
Compare
dlech
reviewed
May 9, 2026
37b4549 to
9e20aad
Compare
BleakClientBlueZDBus.disconnect() now skips the BlueZ Disconnect call when the BLEDevice was retrieved from BleakAdapterBlueZDBus.get_connected_devices(). The marker 'from_connected_devices' is set on the BLEDevice details by get_connected_devices() and read by BleakClient on construction. See bluez/bluez#89.
9e20aad to
e7f4e1c
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BleakClientBlueZDBus.disconnect()now only calls BlueZ Disconnect when this client initiated the connection. The decision is based on afrom_connected_devicesmarker thatBleakAdapterBlueZDBus.get_connected_devices()sets on each returnedBLEDevice.If a device is found already connected at connect() time and the user did not opt into the existing connection (no marker), the client still owns the connection so it can clean up an orphan from a crashed previous run. Only when the
BLEDevicewas retrieved viaBleakAdapter.get_connected_devices()does the new client leave the connection up on close.See bluez/bluez#89.