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: handle device going in and out of range frequently #16

Merged
merged 1 commit into from
Aug 12, 2022

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Aug 12, 2022

services can vanish between connections if the device is
on the edge of bluetooth range. In this case we need
to avoid using the cache. This isnt a problem in the
native bleak implementation but its not merged yet.

This workaround is wrapped with a broad exception
catch so it assumes services cannot be cached if
anything fails in case bleak changes something
under the hood since its making some assumptions
about the implemenation that will not be safe in
future versions

services can vanish between connections if the device is
on the edge of bluetooth range. In this case we need
to avoid using the cache. This isnt a problem in the
native bleak implementation but its not merged yet.

This workaround is wrapped with a broad exception
catch so it assumes services cannot be cached if
anything fails in case bleak changes something
under the hood since its making some assumptions
about the implemenation that will not be safe in
future versions
@bdraco bdraco changed the title fix: handle device going in an out of range fix: handle device going in and out of range frequently Aug 12, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #16 (b644007) into main (0a23bb8) will increase coverage by 0.15%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #16      +/-   ##
==========================================
+ Coverage   98.97%   99.13%   +0.15%     
==========================================
  Files           1        1              
  Lines          98      115      +17     
  Branches       18       22       +4     
==========================================
+ Hits           97      114      +17     
  Misses          1        1              
Impacted Files Coverage Δ
src/bleak_retry_connector/__init__.py 99.13% <100.00%> (+0.15%) ⬆️

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

@bdraco bdraco merged commit 89b8c1b into main Aug 12, 2022
@bdraco bdraco deleted the out_of_range_in_range_fix branch August 12, 2022 18:55
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.

2 participants