summaryrefslogtreecommitdiffstats
path: root/src/hardware_batteryCollection.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-02-16 14:34:08 +0100
committerSlávek Banko <slavek.banko@axis.cz>2020-02-16 14:34:08 +0100
commitfa0e4e246ccb8f436598db4deee1777decfbc702 (patch)
tree3e9950b80df1bf908589c94b596d14c351423c62 /src/hardware_batteryCollection.cpp
parent80c12d8a765e1afb7b9d0d67df0117a95578595c (diff)
downloadtdepowersave-fa0e4e246ccb8f436598db4deee1777decfbc702.tar.gz
tdepowersave-fa0e4e246ccb8f436598db4deee1777decfbc702.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 <slavek.banko@axis.cz>
Diffstat (limited to 'src/hardware_batteryCollection.cpp')
-rw-r--r--src/hardware_batteryCollection.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hardware_batteryCollection.cpp b/src/hardware_batteryCollection.cpp
index 523ca6f..e331492 100644
--- a/src/hardware_batteryCollection.cpp
+++ b/src/hardware_batteryCollection.cpp
@@ -50,7 +50,7 @@ void BatteryCollection::initDefault() {
udis.clear();
- present_rate_unit = "mWh";
+ present_rate_unit = "W";
charging_state = UNKNOWN_STATE;
state = BAT_NORM;
@@ -79,7 +79,7 @@ bool BatteryCollection::refreshInfo(TQPtrList<Battery> BatteryList, bool force_l
int _percent = 0;
int _minutes = 0;
int _present_batteries = 0;
- int _present_rate = 0;
+ double _present_rate = 0;
// for now: clean list before run update process!
udis.clear();
@@ -214,7 +214,7 @@ TQString BatteryCollection::getChargeLevelUnit() const {
}
//! get the current reported battery rate
-int BatteryCollection::getCurrentRate() const {
+double BatteryCollection::getCurrentRate() const {
return present_rate;
}