summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2013-10-06 02:02:00 +0200
committerSlávek Banko <slavek.banko@axis.cz>2013-10-06 02:02:00 +0200
commit10c13fde3ce057bf04c3203805a0d8cac04e64c8 (patch)
tree26f0f9b8bdcfc21ed29955c30055d0dde65055d9 /src
parent160e6f21b8d578aeaba5105082cbb61f46811ef1 (diff)
downloadtdepowersave-10c13fde3ce057bf04c3203805a0d8cac04e64c8.tar.gz
tdepowersave-10c13fde3ce057bf04c3203805a0d8cac04e64c8.zip
Fix warning in getting charge level units
Diffstat (limited to 'src')
-rw-r--r--src/hardware_battery.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/hardware_battery.cpp b/src/hardware_battery.cpp
index 8ae333d..1018254 100644
--- a/src/hardware_battery.cpp
+++ b/src/hardware_battery.cpp
@@ -515,12 +515,12 @@ bool Battery::checkChargeLevelRate () {
*/
bool Battery::checkChargeLevelUnit () {
kdDebugFuncOut(trace);
-
+
// First make sure the battery object is still available
TDEBatteryDevice* bdevice = dynamic_cast<TDEBatteryDevice*>(m_hwdevices->findByUniqueID(udi));
if (!bdevice) {
//grr... no luck
- kdError() << "Battery::checkChargeLevelRate couldn't find battery" << endl;
+ kdError() << "Battery::checkChargeLevelUnit couldn't find battery" << endl;
kdDebugFuncOut(trace);
return false;
}
@@ -531,11 +531,11 @@ bool Battery::checkChargeLevelUnit () {
return false;
}
- // FIXME VERIFY CORRECTNESS
- // what does tdepowersave expect to see in charge_level_unit (battery.charge_level.unit)?
- charge_level_unit = "wH";
- //query was not successfull but this is optional
- kdWarning() << "Couldn't request charge_level.unit for udi: " << udi << endl;
+ // Power supply energy informations in sysfs are always in uWh.
+ // https://www.kernel.org/doc/Documentation/power/power_supply_class.txt
+ // TDE hardware library internally uses Wh.
+ // Since charge level unit are always Wh.
+ charge_level_unit = "Wh";
kdDebugFuncOut(trace);
return false;
}