UPower.Device.Percentage: Percentage property defaults to battery Capacity instead of "percentage of EnergyFull"
It seems that the sysfs value for Capacity is assumed to be the same as current Percentage of charge in linux/up-device-supply.c
.
In my macbook11,1 the battery currently holds 82% of its original design, so upower reports my battery as "0 to 82%" in places like the gnome-shell panel, and other consumers of the Percentage property.
I believe Percentage should default to "percentage of EnergyFull", and fallback to Capacity only if there is no energy information. Right now, the code does the opposite, defaulting to Capacity.
Original report:
While this is not strictly a bug, I would propose to make Percentage represent "Energy/EnergyFull" instead of "Energy/EnergyFullDesign" as a concession to let most users make sense of their battery level.
In my macbook11,1 the battery currently holds 82% of its original design, so upower reports my battery as "0 to 82%" in places like the gnome-shell panel, and other consumers of the property. This can get weird as "50%" remaining is actually more like ~40% percent of the actual energy remaining. In a dual-boot system a user could also find it weird that "Linux has less battery".
I would propose that "Percentage" always report the current Energy relative to EnergyFull (where possible. I understand there's a few considerations for systems with incomplete info).
My rationale is that most API users, and by extent end-users, of a "Percentage" property would expect the more familiar "0 to 100" number. The current behavior would be more in line with something like a "Battery Health" calculation (maybe a convenient new "PercentageDesign" could exist?).
As an example, here's what d-feet reports for my battery in org.freedesktop.UPower.Device: