From 3a1251976e9b5253f2a9a2760a5d94d23f6a0a61 Mon Sep 17 00:00:00 2001 From: Jorge Gonzalez Date: Tue, 13 Feb 2018 11:23:40 -0500 Subject: [PATCH] Fix typo that caused ischarging to be innaccurate --- lib/battery.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/battery.js b/lib/battery.js index 5660ca2..2c514b3 100644 --- a/lib/battery.js +++ b/lib/battery.js @@ -100,7 +100,7 @@ module.exports = function (callback) { exec('ioreg -n AppleSmartBattery -r | egrep "CycleCount|IsCharging|MaxCapacity|CurrentCapacity";pmset -g batt | grep %', function (error, stdout) { let lines = stdout.toString().replace(/ +/g, '').replace(/"+/g, '').replace(/-/g, '').split('\n'); result.cyclecount = parseInt('0' + util.getValue(lines,'cyclecount', '='), 10); - result.ischarging = util.getValue(lines,'ischarging', '=').toLowerCase === 'yes'; + result.ischarging = util.getValue(lines,'ischarging', '=').toLowerCase() === 'yes'; result.maxcapacity = parseInt('0' + util.getValue(lines,'maxcapacity', '='), 10); result.currentcapacity = parseInt('0' + util.getValue(lines,'currentcapacity', '='), 10); let percent = -1;