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

Force reconnect when GATT services are missing to re-resolve services #240

Merged
merged 4 commits into from
Nov 5, 2022

Conversation

bdraco
Copy link
Collaborator

@bdraco bdraco commented Nov 5, 2022

Sometimes BlueZ fails to get all the services. If we disconnect and reconnect it resolves the problem.

This PR defines a wrapper that forces disconnect when the underlying code encounters a missing GATT service
or char

fixes #238

This only fixes the ones that fail to resolve sometimes unlikely #135 where they fail to resolve always.

@codecov
Copy link

codecov bot commented Nov 5, 2022

Codecov Report

Base: 66.99% // Head: 66.95% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (a169b88) compared to base (11031f6).
Patch coverage: 65.38% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #240      +/-   ##
==========================================
- Coverage   66.99%   66.95%   -0.04%     
==========================================
  Files          71       71              
  Lines        6590     6613      +23     
==========================================
+ Hits         4415     4428      +13     
- Misses       2175     2185      +10     
Flag Coverage Δ
unittests 66.95% <65.38%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiohomekit/controller/ble/bleak.py 29.41% <60.00%> (+2.58%) ⬆️
aiohomekit/controller/ble/pairing.py 22.08% <66.66%> (+1.21%) ⬆️
aiohomekit/controller/ip/connection.py 81.52% <0.00%> (-0.96%) ⬇️

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 5, 2022 18:44
@bdraco bdraco merged commit 4f7afa0 into main Nov 5, 2022
@bdraco bdraco deleted the missing_gatt_services branch November 5, 2022 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants