That previous summary doesn't handle the two batteries charging, which should be a common occurrence. Let's try that again:
* If the laptop has two or more DISCHARGING batteries (Rob's case), we could use an average of their percentages and the maximum of their time-remaining values.
* Otherwise, if the laptop has one DISCHARGING and one or more IDLE batteries (Mathieu's case), we could use an average of their percentages and the sum of time-remaining.
* Otherwise, if the laptop has one or more CHARGING or IDLE batteries, we could use an average of their percentages and the maximum of the CHARGING time-remaining values.
* Otherwise, if the laptop has both CHARGING and DISCHARGING batteries at the same time... first off, I'm not sure this is a meaningful use case? What icon would we use? :) We could use an average of the batteries' percentages and either not report a time, or use the maximum of the DISCHARGING time-remaining values.
* Otherwise, do not average batteries together in the header.
That previous summary doesn't handle the two batteries charging, which should be a common occurrence. Let's try that again:
* If the laptop has two or more DISCHARGING batteries (Rob's case), we could use an average of their percentages and the maximum of their time-remaining values.
* Otherwise, if the laptop has one DISCHARGING and one or more IDLE batteries (Mathieu's case), we could use an average of their percentages and the sum of time-remaining.
* Otherwise, if the laptop has one or more CHARGING or IDLE batteries, we could use an average of their percentages and the maximum of the CHARGING time-remaining values.
* Otherwise, if the laptop has both CHARGING and DISCHARGING batteries at the same time... first off, I'm not sure this is a meaningful use case? What icon would we use? :) We could use an average of the batteries' percentages and either not report a time, or use the maximum of the DISCHARGING time-remaining values.
* Otherwise, do not average batteries together in the header.