another optimization battery().ischarging for macOS

This commit is contained in:
Sebastian Hildebrandt
2018-04-05 23:16:38 +02:00
parent 6d30c351fc
commit c912bdc6fe
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ module.exports = function (callback) {
}
}
if (parts && parts[1]) {
result.ischarging = parts[1].trim() !== 'charged';
result.ischarging = !(parts[1].trim() === 'charged' || parts[1].trim() === 'discharging');
} else {
result.ischarging = util.getValue(lines, 'ischarging', '=').toLowerCase() === 'yes';
}