[-]
[+]
|
Changed |
_service:tar_git:harbour-chargemon-0.4.3.tar.bz2/qml/pages/InfoPage.qml
^
|
@@ -73,6 +73,7 @@
ListElement { title: "USB Connection type"; param: "type" }
ListElement { title: "USB Max charging current"; param: "current_max" }
ListElement { title: "Health"; param: "health" }
+ ListElement { title: "Capacity left"; param: "capacity_left" }
ListElement { title: "Technology"; param: "technology" }
}
|
@@ -112,6 +112,10 @@
infoPageValues << "/sys/devices/platform/msm_ssbi.0/pm8038-core/pm8921-charger/power_supply/usb/type";
infoPageValues << "/sys/devices/platform/msm_ssbi.0/pm8038-core/pm8921-charger/power_supply/usb/current_max";
+ infoPageRawValues.clear();
+ infoPageRawValues << "/sys/devices/platform/msm_ssbi.0/pm8038-core/pm8921-charger/power_supply/battery/charge_full";
+ infoPageRawValues << "/sys/devices/platform/msm_ssbi.0/pm8038-core/pm8921-charger/power_supply/battery/charge_full_design";
+
res = true;
}
else if (outArgs.at(0).toString() == "onyx") /* OneplusX */
@@ -132,6 +136,10 @@
infoPageValues << "/sys/devices/qpnp-charger-f6169000/power_supply/qpnp-dc/type";
infoPageValues << "/sys/devices/qpnp-charger-f6169000/power_supply/qpnp-dc/current_max";
+ infoPageRawValues.clear();
+ infoPageRawValues << "/sys/devices/qpnp-charger-f6169000/power_supply/battery/charge_full";
+ infoPageRawValues << "/sys/devices/qpnp-charger-f6169000/power_supply/battery/charge_full_design";
+
res = true;
}
else if (outArgs.at(0).toString() == "fp2-sibon")
@@ -152,6 +160,10 @@
infoPageValues << "/sys/devices/qpnp-charger-f6274800/power_supply/qpnp-dc/type";
infoPageValues << "/sys/devices/qpnp-charger-f6274800/power_supply/qpnp-dc/current_max";
+ infoPageRawValues.clear();
+ infoPageRawValues << "/sys/devices/qpnp-charger-f6274800/power_supply/battery/charge_full";
+ infoPageRawValues << "/sys/devices/qpnp-charger-f6274800/power_supply/battery/charge_full_design";
+
res = true;
}
else if (outArgs.at(0).toString() == "JP-1601") /* Jolla C */
@@ -172,6 +184,9 @@
infoPageValues << "/sys/devices/soc.0/78d9000.usb/power_supply/usb/type";
infoPageValues << "/sys/devices/soc.0/78d9000.usb/power_supply/usb/current_max";
+ infoPageRawValues.clear();
+ /* charge_full, charge_full_design not available on Jolla C */
+
res = true;
}
return res;
@@ -296,6 +311,25 @@
}
}
+ if (infoPageRawValues.count() >= 2)
+ {
+ uint energy_full = readOneLineFromFile(infoPageRawValues.at(0)).toInt();
+ uint energy_full_design = readOneLineFromFile(infoPageRawValues.at(1)).toInt();
+
+ if (energy_full_design > 0)
+ {
+ m_infoPage.insert("capacity_left", QString::number(100*energy_full/energy_full_design) + "%");
+ }
+ else
+ {
+ m_infoPage.insert("capacity_left", "Unknown");
+ }
+ }
+ else
+ {
+ m_infoPage.insert("capacity_left", "Unknown");
+ }
+
/* contextproperties */
m_infoPage.insert("time_until_low", QDateTime::fromTime_t(propertyTimeUntilLow->value().toInt()).toUTC().toString("hh:mm:ss"));
|