commit
5bdc816969
@ -244,13 +244,13 @@ module.exports = function (callback) {
|
||||
batteries[batteries.length - 1].push(parts[i]);
|
||||
}
|
||||
}
|
||||
let designCapacities = data.results[1].split('\r\n');
|
||||
let fullChargeCapacities = data.results[2].split('\r\n');
|
||||
let designCapacities = data.results[1].split('\r\n').filter(e => e);
|
||||
let fullChargeCapacities = data.results[2].split('\r\n').filter(e => e);
|
||||
if (batteries.length) {
|
||||
let first = false;
|
||||
let additionalBatteries = [];
|
||||
for (let i = 0; i < batteries.length; i++) {
|
||||
let lines = batteries[i];
|
||||
let lines = batteries[i][0].split('\r\n');
|
||||
const designedCapacity = designCapacities && designCapacities.length >= (i + 1) && designCapacities[i] ? util.toInt(designCapacities[i]) : 0;
|
||||
const fullChargeCapacity = fullChargeCapacities && fullChargeCapacities.length >= (i + 1) && fullChargeCapacities[i] ? util.toInt(fullChargeCapacities[i]) : 0;
|
||||
const parsed = parseWinBatteryPart(lines, designedCapacity, fullChargeCapacity);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user