summaryrefslogtreecommitdiffstats
path: root/src/hardware_battery.h
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2020-02-16 14:34:08 +0100
committerSlávek Banko <[email protected]>2020-02-16 16:32:51 +0100
commit7a52a4c33fb633a6bf227daf31e4ab65a444032e (patch)
treeaef907589ed987f98a54784872a6880c122e003e /src/hardware_battery.h
parent6609acc640521ae6d1d381c1d411c56d9be8cee3 (diff)
downloadtdepowersave-7a52a4c33fb633a6bf227daf31e4ab65a444032e.tar.gz
tdepowersave-7a52a4c33fb633a6bf227daf31e4ab65a444032e.zip
Fix units of current consumption value.
Previously it was not clear whether the units in tdehwlib are in Wh and W or Ah and A. Now the units are always Ah and A. Because power consumption is usually given in W, the value is converted from A to W. If it is less than 100 W, it is displayed as a decimal number. This is related to issue TDE/tdelibs#68. Signed-off-by: Slávek Banko <[email protected]> (cherry picked from commit fa0e4e246ccb8f436598db4deee1777decfbc702)
Diffstat (limited to 'src/hardware_battery.h')
-rw-r--r--src/hardware_battery.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hardware_battery.h b/src/hardware_battery.h
index 8f9a268..36bf68c 100644
--- a/src/hardware_battery.h
+++ b/src/hardware_battery.h
@@ -162,7 +162,7 @@ private:
* second) the currently reported charging/discharging rate.
* \li a value >= 0
*/
- int present_rate;
+ double present_rate;
//! Expected minutes unitl fully discharged/charged
/*!
* This int tells the current estimate until the battery is fully
@@ -262,8 +262,8 @@ public:
int getState() const;
//! estimates the remaining minutes until fully charged/discharged
int getRemainingMinutes() const;
- //! current charging/discharging rate
- int getPresentRate() const;
+ //! current charging/discharging rate
+ double getPresentRate() const;
//! maximum capacity of this battery by design
int getDesignCapacity() const;
//! current charging state as enum BAT_CHARG_STATE