-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
Default to gatttoolbackend with bluepybackend backup #27673
Conversation
This switch corrects an issue with bluepy disconnecting from devices after some time. Gatttool is currently unaffected by this issue.
Hi @helenclarko, It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
Hey there @Danielhiversen, @ChristianKuehnel, mind taking a look at this pull request as its been labeled with a integration ( |
I'm new to creating a pull request for Home assistant, please excuse any mistakes that are made. |
I would not encourage using gatttool:
I would rather like to have someone understand what is really causing the problem and fix the root cause. |
It's available in hassio and although it may be slower it works. |
@ChristianKuehnel |
We should not prefer/promote deprecated packages |
We should also not have broken components, should we? While I truly understand the wish to not have "ugly code" in the repo, I'd appreciate if there was any way to have various Mi* bluetooth devices working properly again after 4+ months. As both ways are in the code currently, would it be an option to have a component config entry to switch between them, defaulting to bluepy? |
My point is: Do not implement workarounds. Understand the root cause of the problem and fix it. For whatever reasons miflora is working fine on the 3 machines I'm running it on. |
@balloob the issue is, that Bluetooth and python are not friends and maybe also not friends with Linux. The new kernel Bluetooth interface is so bad supported that to use However, the needed library also depends on the driver blob and Kernel version. So maybe not a bad idea to allow a configuration/options for this because we can't handle that correct for every one automatic. |
@pvizeli In that case we should make this configurable from the Or should HomeAssistant offer a generic Bluetooth API and then pick the right implementation underneath that fits the hardware automatically? |
Guess the question is does bluepy work for anyone at the moment, with this current bug? As for Miflora running fine on 3 of your machines, I'm not sure how that helps to solve the issue. Perhaps you can send me one haha? |
Can we figure out, which hardware is causing the problem? And then either push bluepy to address this or analyze/fix it ourselves? Or maybe give our users a hint on which hardware to use/avoid. What I wanted to say with my 3 machines: My problem here is that I cannot reproduce the problem, so I have no clue how to proceed, |
Like I said, the issue is the Linux Kernel/Bluez interface, which have different interfaces and depend on what the vendor blob use, it work different. The library is only so stable as the Linux Kernel allow to be and the current Bluetooth support is for linux is bad add all. Some vendor/drivers/blobs work fine with new interface but bad with old but that is also happens into other direction. |
Going to close this. One is not better than the other, so swapping them around just makes it worse for other people. |
The solution would be to make it configurable |
This change corrects an issue with bluepy disconnecting from devices after some time.
Gatttool is currently unaffected by this issue.
No code change, code has just been rearranged
Description:
Related issue (if applicable): same change has fixed mitemp_bt sensor: #27672
Checklist:
tox
. Your PR cannot be merged unless tests passIf the code does not interact with devices: