diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bed039..d918cc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 4.14.7 | 2019-08-22 | `battery()` windows acconnected improvement | | 4.14.6 | 2019-08-22 | `users()` improved date time parsing | | 4.14.5 | 2019-08-22 | `fsSize()` fix windows result as number | | 4.14.4 | 2019-07-20 | `verions()` fix pip, pip3 | diff --git a/docs/history.html b/docs/history.html index fee2e83..d89def3 100644 --- a/docs/history.html +++ b/docs/history.html @@ -83,6 +83,11 @@ + + 4.14.7 + 2019-08-22 + battery() windows acconnected improvement + 4.14.6 2019-08-22 diff --git a/docs/index.html b/docs/index.html index 080b3b9..3eaa96e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -168,7 +168,7 @@
systeminformation
-
Current Version: 4.14.6
+
Current Version: 4.14.7
diff --git a/lib/battery.js b/lib/battery.js index e274c35..8ea767a 100644 --- a/lib/battery.js +++ b/lib/battery.js @@ -185,7 +185,7 @@ module.exports = function (callback) { result.percent = parseInt(util.getValue(lines, 'EstimatedChargeRemaining', '=') || 0); result.currentcapacity = parseInt(result.maxcapacity * result.percent / 100); result.ischarging = (statusValue >= 6 && statusValue <= 9) || statusValue === 11 || (!(statusValue === 3) && !(statusValue === 1) && result.percent < 100); - result.acconnected = result.ischarging; + result.acconnected = result.ischarging || statusValue === 2; } } if (callback) { callback(result); }