-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
support gattlib as an alternative btle library #48
Conversation
Just a quick note, I think it would make more sense to convert the library to use bleak (which also supports windows and mac) and maybe remove the bluepy support altogether after that. |
As a longer-term goal, supporting bleak definitely makes sense. However now, gattlib is widely available (https://repology.org/project/pygattlib/versions). And given that eq3bt has a good abstraction of the underlying connection object, this additional support has a small maintenance cost. |
Fair enough, I think we can add gattlib support but we need to figure out how to mark that either of the two is required as a dependency. And maybe make it configurable, in case someone prefers to use the gattlib even when bluepy is installed. |
You already made it configurable! The |
Ah, indeed! So the way to make it configurable would work like follows:
|
I implemented the requested changes. Do you want me to resolve conflicts? If yes, via merge or rebase? |
Looking good, thanks! It doesn't matter whether you do a rebase or merge, I personally usually just do a rebase to avoid merge commits for PRs, and then squash-merge to master when ready. |
The default should continue being bluepy, but the import of the connection class can be avoided when a connection class is passed.
I rebased the branch on master. master introduced a small bug that is fixed as an additional commit here. Hope that's ok. |
That's fine, the test suite is rather lackluster so I didn't spot that difference between the custom click-datetime and the now-standard one :| Please run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @helmutg! 🥇
Thank you for writing this library. I found using it with bluepy didn't work well for me:
bluepy-helper
reduces performance and reliability.bluepy
uses a little strange build system for building itsbluepy-helper
.bluepy
is not included in Debian.As an alternative,
gattlib
provides roughly the same functionality. Indeed,eq3bt
is written so well that replacing the connection class is a relatively simple matter. As such I propose adding another implementation of it such that it can be used with eitherbluepy
(default) orgattlib
. What do you think?