another optimization battery().ischarging for macOS
This commit is contained in:
parent
6d30c351fc
commit
c912bdc6fe
@ -100,6 +100,7 @@ Other changes
|
||||
|
||||
| Version | Date | Comment |
|
||||
| -------------- | -------------- | -------- |
|
||||
| 3.37.12 | 2018-04-05 | another optimization `battery().ischarging` for macOS |
|
||||
| 3.37.11 | 2018-04-05 | another optimization `battery().ischarging` for macOS |
|
||||
| 3.37.10 | 2018-04-05 | `battery().ischarging` optimized for macOS |
|
||||
| 3.37.9 | 2018-04-03 | optimized `processes()`, bugfix `networkInterfaceDefault()` |
|
||||
|
||||
@ -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';
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user