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

fix: increase backoff when local ble adapter runs out of connection slots #67

Merged
merged 12 commits into from
Nov 11, 2022

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Nov 11, 2022

In testing it was found that most of the CSR adapters only support 5 slots and the broadcom only support 7 slots.

When they run out of slots the device they are trying to connect to disappears from the bus so we must backoff

@codecov
Copy link

codecov bot commented Nov 11, 2022

Codecov Report

Base: 85.57% // Head: 85.38% // Decreases project coverage by -0.18% ⚠️

Coverage data is based on head (1fb96df) compared to base (1396fdc).
Patch coverage: 66.66% of modified lines in pull request are covered.

❗ Current head 1fb96df differs from pull request most recent head 0b81737. Consider uploading reports for the commit 0b81737 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #67      +/-   ##
==========================================
- Coverage   85.57%   85.38%   -0.19%     
==========================================
  Files           2        2              
  Lines         298      301       +3     
  Branches       73       74       +1     
==========================================
+ Hits          255      257       +2     
- Misses         30       31       +1     
  Partials       13       13              
Impacted Files Coverage Δ
src/bleak_retry_connector/__init__.py 87.58% <66.66%> (-0.23%) ⬇️

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 marked this pull request as ready for review November 11, 2022 01:29
@bdraco bdraco merged commit cac7e57 into main Nov 11, 2022
@bdraco bdraco deleted the fix_out_of_slots branch November 11, 2022 01:32
bdraco added a commit to sblibs/pySwitchbot that referenced this pull request Nov 11, 2022
In Bluetooth-Devices/bleak-retry-connector#67
we discovered that most of the CSR adapters only have 5 connection slots
so we want to reduce the chance we will not be able to make a connection
because we are still holding the connection to another switchbot.

We still hold the connection for 8.5 seconds every time they
do an action to ensure if they want to turn on a light and change
a color the whole action happens in a single connection.
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