Comment 0 for bug 1430542

Revision history for this message
desrt (desrt) wrote :

The indicator implements the spec:

  https://wiki.ubuntu.com/Power#Handling_multiple_batteries

which states:

  "Their percentages should be averaged."

Apparently this was taken to mean the simple arithmetic mean, and not the weighted average (by the capacity of each battery).

  http://bazaar.launchpad.net/~indicator-applet-developers/indicator-power/trunk.15.04/view/head:/src/service.c#L1316

shows:

  const double percent = sum_percent / n_batteries;

This means that if one battery is twice as large as another, then after that battery is discharged, 50% would be reported. I'd expect 33%.

The spec needs to be updated to be less ambiguous about the intended meaning of the word "average" and the code needs to be fixed.