From 10c13fde3ce057bf04c3203805a0d8cac04e64c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 6 Oct 2013 02:02:00 +0200 Subject: [PATCH] Fix warning in getting charge level units --- src/hardware_battery.cpp | 14 +++++++------- 1 file 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(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; }