SystemKit icon indicating copy to clipboard operation
SystemKit copied to clipboard

Not showing correct battery charge

Open pkrll opened this issue 9 years ago • 2 comments

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

pkrll avatar Jun 29 '16 21:06 pkrll

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

beltex avatar Nov 21 '16 01:11 beltex

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

arjndr avatar Nov 13 '18 19:11 arjndr