It seems there is an typo in the code that detects discharging. There is another check in sysfs.cpp, so despite of this typo the detection works correctly with sysfs backend. But the alternate power_supply backend doesn't have this check, so if used, it doesn't work correctly. I think the typo should be fixed or the check should be removed from measurement.cpp (maybe together with the power_supply implementation). The latter solution is probably more clear. --- src/measurement/measurement.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/measurement/measurement.cpp b/src/measurement/measurement.cpp index 57dc9c4..4a33db9 100644 --- a/src/measurement/measurement.cpp +++ b/src/measurement/measurement.cpp @@ -145,7 +145,7 @@ void power_supply_callback(const char *d_name) while (file) { file.getline(line, 4096); - if (strstr(line, "POWER_SUPPLY_STATUS") && strstr(line, "POWER_SUPPLY_STATUS")) + if (strstr(line, "POWER_SUPPLY_STATUS") && strstr(line, "Discharging")) discharging = true; } file.close(); -- 1.7.7.6 _______________________________________________ Power mailing list Power@bughost.org https://bughost.org/mailman/listinfo/power