Calculate remaining battery lifetime considering ALL installed batteries

Review Request #116481 - Created Feb. 28, 2014 and submitted

Joschi Brauchle
Currently powerdevil uses the "time-to-empty" property provided by upower to add up battery life for all installed batteries. 
Unfortunately, upower 0.9.x does not provide a "time-to-empty" for fully charged batteries.
Hence, the remaining battery lifetime displayed by powerdevil considers only batteries which are currently being discharged and ignores all fully charged batteries.

The proposed patch is taken from upower 0.99.x and sums up the total energy available in all installed batteries (discharging and charged) and divides it by the current total discharge rate over all batteries (this is for lifetime, similarly for charge time).
Tested with KDE 4.11.6 on Thinkpad T440s with 
- two batteries installed
- one battery installed


  • 2
  • 3
  • 0
  • 5
Description From Last Updated if () { } else ... { } Quote from the coding style: "Use curly braces even when the ... Mark Gaiser Mark Gaiser
curly braces.. Mark Gaiser Mark Gaiser
Kai Uwe Broulik
Mark Gaiser
Kai Uwe Broulik
Kai Uwe Broulik
Lukáš Tinkl
Joschi Brauchle
Review request changed

Status: Closed (submitted)