-
Notifications
You must be signed in to change notification settings - Fork 28
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
Remove pygatt and use bluepy.btle #47
Conversation
…sted this file main function on rpi4 and that works.
I think this is the right move for this component. Moving away from PYGATT. As it seems to be deprecated. Please note: I had to execute the following command in the docker container to install bluepy successfully; I have been logging connection errors on the original component for about 6 months. The counter was at; |
@sverrham , I'm very excited to try this out! |
I think all we have to do is add the dependency to the https://github.com/custom-components/sensor.airthings_wave/blob/master/custom_components/airthings_wave/manifest.json file and remove the reference to the old pygatt requirement for good measure. "requirements": ["bluepy==1.3.0"] |
Does Home Assistant OS support bluepy? If not can we request that they do?
…On Mon, Mar 15, 2021 at 8:02 AM Martin Tremblay ***@***.***> wrote:
Please note: I had to execute the following command in the docker
container to install bluepy successfully;
pip install --find-links $WHEELS_LINKS bluepy==1.3.0
I think all we have to do is add the dependency to the
https://github.com/custom-components/sensor.airthings_wave/blob/master/custom_components/airthings_wave/manifest.json
file and remove the reference to the old pygatt requirement for good
measure.
"requirements": ["bluepy==1.3.0"]
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#47 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AM52J4EHR36RZISYEWCQJ53TDYAQBANCNFSM4ZFOOATQ>
.
|
Pretty sure it does. There are a few built-in components that require it. |
I was looking for a little bit what library to use, what would be maintained, did not realy land on anything as the best candidate so I just used what Airthings has used in their examples. Don't think bluepy actually is maintained so maybe we need to change down the road, but the hope is that it is more stable then current solution. |
Just tried this out. Works great @sverrham ! I did notice that it did incremented the name of the entities. for example, where I had @mindtripper , let us know how your testing goes. If all looks well, I'll merge the PR and up the version to v3.0 |
@MartyTremblay I experience the same as you did.
I also experienced an issue with capital letters in the So far today, I have had no issues with connectivity. Will keep you and @sverrham posted on the stability. |
Strange the uniqe id should be the same, I did not check, but for me the old code seems to have capital letters for the mac, if the new code does not I guess that might be the reason, lets fix that.
Should fix this also. |
Fix bug with mac entered, always use lowercase mac to connect, so entered mac case does not matter. Fix bug changed entity, force to use uppercase mac for unique id.
So this latest commit should fix the mac issues and duplicate entities, now upper case is enforced for the unique name so it should be the same no matter what is found or entered. Sorry @mindtripper @MartyTremblay this should break your sensor ids again, but should be consistent going forward, I hope. |
No worries @sverrham. I'm impressed with your effort! With the latest PR's, I can use upper and lower case without issues. All tested, No problems. |
So I have not tested this update in HA, but tested standalone to work on a rpi4.
If you want you can try it out, review it. I don't know if I have time to test it in HA until next weekend.
Hope it should improve stability by removing pygatt, don't know if it will.