-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
Change the way of checking the charging state #308
Conversation
Thanks for looking into this! This change was originally started as part of #168 based on a lot of user feedback. Proposed changes looks sound and they also worked on my side (X1 Carbon), I just wish if we had more confirmations that it works on various/different hardware. It would be great if battery detection issues could be solved once and for all, as besides the issues you mentioned, these issues keep popping up. Let me think about this and in meantime let's wait for confirmations in #307 and #299. |
Yes, I totally understand. I would love to see way more users test this before actually merged into master. |
Note for this PR after reading alot of earlier issues. As seen in #124 "hid" devices may show up under /sys/class/power_supply/ as discharging battery. |
This is really great. Already all the issues are reported as fixed. I have told that we need probably need a little bit more testing before actually merging this. One other thing that makes me very happy. One person mentioned that the PR #285 had fixed an issue for them, and had positive results with this current PR also. Which is great, because codewise they are totally different. So I think we are on the right track! Maybe you could make an issue with a request for testing this. I don't see any other way to get people to test this without actually having problems at this moment. |
This is definitely the step in right direction. Here's an idea, what if we use logic you implemented as part of this PR as "main" logic, and as a "fallback" (at the end of loop in case nothing was matched) use the old mechanism to determine if device is charging or not? This way, we could have best of the both worlds. This can also be a transitory thing, where once we've determined that new "main" logic catches every case old mechanism can be completely removed. If we had this I would just merge this with |
I really don't know. Just leave it here and see how it works out. |
@bobslept I've decided to merge these changes with Please do be aware I will tap you if I see this top of issues 🙂 |
Really interesting to see what happends. Will be on top of new battery issues 😇 |
Would always be charging, unless a battery tells us we are discharging, or the AC we found tells us we are connected to a cable.
This would also work on systems where somehow we cannot find an AC but only a battery. Which I have seen in some earlier opened issues.
Works on my system with ACAD as AC and BAT1 as battery
Fixes issue #306
Fixes issue #307
Fixes issue #299