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

Ignore incorrectly reported batteries and ignore unhandled power_supp… #186

Open
wants to merge 2 commits into
base: lmt-upstream
Choose a base branch
from

Conversation

labre
Copy link

@labre labre commented Apr 6, 2022

…ly types

Sorry, misinterpreted the Github interface. I’m tired. This PR fixes Bug #183 also for unpatched kernels and will also ignore any unhandled power_supply types. This should prevent issues like this in the future. Of course USB chargers could be handled, if their drivers report a charging state in the future. But even in that case there should be at least one battery found before we assume a mobile device.

Anyway,
Closes: #183

@labre
Copy link
Author

labre commented Apr 8, 2022

With the new commit we check correctly for the scope of the battery. Non-system batteries should be ignored, because they may belong to wireless mice or keyboards and basically anything with its own battery, if those devices report their charging status to the kernel.

I’ve tested it and it works as expected. Please merge this bug fix. :)

@rickysarraf rickysarraf self-assigned this Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ON_AC on desktop PCs - unset when iPhone gets USB attached
2 participants