battery() windows acconnected improvement

This commit is contained in:
Sebastian Hildebrandt 2019-08-22 15:31:51 +02:00
parent 4563b10c5f
commit 8c8072d37c
4 changed files with 8 additions and 2 deletions

View File

@ -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 |

View File

@ -83,6 +83,11 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">4.14.7</th>
<td>2019-08-22</td>
<td><span class="code">battery()</span> windows acconnected improvement</td>
</tr>
<tr>
<th scope="row">4.14.6</th>
<td>2019-08-22</td>

View File

@ -168,7 +168,7 @@
<img class="logo" src="assets/logo.png">
<div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span></div>
<div class="version">Current Version: <span id="version">4.14.6</span></div>
<div class="version">Current Version: <span id="version">4.14.7</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div>
<div class="down">

View File

@ -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); }