Update battery.js

fix windows batterys being in an array
This commit is contained in:
Simon Smith 2022-01-17 12:24:44 +00:00 committed by GitHub
parent 783bc3d43b
commit 4069e8591f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -250,7 +250,7 @@ module.exports = function (callback) {
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);