Fix warning in getting charge level units

pull/1/head
Slávek Banko 11 years ago
parent 160e6f21b8
commit 10c13fde3c

@ -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;
}

Loading…
Cancel
Save