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

Not showing correct battery charge #22

Open
pkrll opened this issue Jun 29, 2016 · 2 comments
Open

Not showing correct battery charge #22

pkrll opened this issue Jun 29, 2016 · 2 comments

Comments

@pkrll
Copy link

pkrll commented Jun 29, 2016

I don't know if this is a bug or just me. But using the Battery method charge() doesn't seem to return the correct charge. It's about 5-6 percents lower than what it should be.

screen shot 2016-06-29 at 23 27 47 screen shot 2016-06-29 at 23 28 45

@beltex
Copy link
Owner

beltex commented Nov 21, 2016

Hello @pkrll!

Sorry about the late response on this!

Few possibilities:

  • System menu bar doesn't poll as often, so it's not up to date?
  • System menu bar calls a different underlying API/computes the value slightly differently?
  • Rounding error in SystemKit

Could cross check with Apple's own tool via, pmset -g batt

@arjndr
Copy link

arjndr commented Nov 13, 2018

2 years later and can confirm this on macOS Mojave
image
image

EDIT :
This seems to be an issue with the IOKit library

pmset -g batt returns the battery percentage displayed on the menubar but when I convert the output from ioreg -w0 -l | grep Capacity command, which I think uses the IOKit library, the battery percentage is off by 3-6%

EDIT 2 :
Ok this is interesting, pmset -g rawlog shows incorrect battery percentage too, but pmset -g batt does not, I don't even know which one is incorrect anymore lol

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

No branches or pull requests

3 participants