Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: do not disconnect unexpectedly connected devices if bleak supports reusing them #35

Merged
merged 4 commits into from
Sep 14, 2022

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Sep 14, 2022

Bleak 0.17 supports connecting to devices that are already connected in BlueZ.

We now detect this and adjust the BLEDevice to point to the already
connected device so they do not have to wait for a connection.

This also fixes a race where the connection times out but the connection is actually
made on the bus but we think it failed because we hit the timeout, so the next attempt
will instead sail right though and be connected.

@codecov
Copy link

codecov bot commented Sep 14, 2022

Codecov Report

Base: 85.05% // Head: 88.47% // Increases project coverage by +3.41% 🎉

Coverage data is based on head (b62be8c) compared to base (fe7ec26).
Patch coverage: 91.30% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #35      +/-   ##
==========================================
+ Coverage   85.05%   88.47%   +3.41%     
==========================================
  Files           2        2              
  Lines         261      269       +8     
  Branches       57       59       +2     
==========================================
+ Hits          222      238      +16     
+ Misses         33       24       -9     
- Partials        6        7       +1     
Impacted Files Coverage Δ
src/bleak_retry_connector/__init__.py 88.40% <91.30%> (+0.79%) ⬆️
src/bleak_retry_connector/dbus.py 89.47% <0.00%> (+36.84%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bdraco bdraco changed the title fix: do not disconnect unexpectedly connected devices if bleak supports reusing them feat: do not disconnect unexpectedly connected devices if bleak supports reusing them Sep 14, 2022
@bdraco bdraco merged commit be603ce into main Sep 14, 2022
@bdraco bdraco deleted the already_connected_always_wins branch September 14, 2022 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant