battery() fixed isCharging (windows)

This commit is contained in:
Sebastian Hildebrandt
2021-10-08 11:10:11 +02:00
parent e435597100
commit b6d2fe0c44
4 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ function parseWinBatteryPart(lines, designedCapacity, fullChargeCapacity) {
result.percent = parseInt(util.getValue(lines, 'EstimatedChargeRemaining', '=') || 0);
result.currentCapacity = parseInt(result.maxCapacity * result.percent / 100);
result.isCharging = (statusValue >= 6 && statusValue <= 9) || statusValue === 11 || (!(statusValue === 3) && !(statusValue === 1) && result.percent < 100);
result.acConnected = result.ischarging || statusValue === 2;
result.acConnected = result.isCharging || statusValue === 2;
result.model = util.getValue(lines, 'DeviceID', '=');
} else {
result.status = -1;