macchina
macchina copied to clipboard
Wrong battery value on MacOS
The macchina battery percentage value doesn't match the MacOS system's (about 3 less)
It would help if you provided your macOS, macchina and libmacchina versions.
MacOS Sonoma 14.2.1 macchina 6.1.8 libmacchina 6.3.5
Can anyone with Apple hardware confirm this? If so, please let us know by contributing to the conversation.
I see this issue with the battery too. Let me know if I can help debug the issue.
# native macOS tool
$ pmset -g batt
Now drawing from 'Battery Power'
-InternalBattery-0 (id=33816675) 93%; discharging; 16:46 remaining present: true
# macchina
Battery - 88% & Discharging
Third-party battery replacements have caused issues, though way more sinister than this, in the past ^1. Are these miscalculations occuring on machines with an authentic battery?
Yes! My machine is brand new, from the Apple store.
My MacBook also has the factory installed battery. Utils like pmset -g batt seem accurate while the calculation with macchina seem off.
I'll defer this to @123marvin123 as he knows more about the macOS side of things than I do.
I'm not sure what could be the reason for these larger differences between the "pmset -g batt" command and macchinas readout. For macchina, the values are coming directly from IOKit. Only minor floating point -> int conversion are expected.
This is what I get on my MacBook Air M1 with original battery:
pmset -g batt
Now drawing from 'Battery Power'
-InternalBattery-0 (id=22282339) 71%; discharging; 4:17 remaining present: true
Battery - 70% & Discharging