battery() fixed isCharging (windows)

This commit is contained in:
Sebastian Hildebrandt 2021-10-08 11:10:11 +02:00
parent e435597100
commit b6d2fe0c44
4 changed files with 8 additions and 2 deletions

View File

@ -80,6 +80,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment |
| -------------- | -------------- | -------- |
| 5.9.5 | 2021-10-08 | `battery()` fixed isCharging (windows) |
| 5.9.4 | 2021-09-23 | `processes()` fixed memVsz, Memrss (macOS M1) |
| 5.9.3 | 2021-09-17 | `cpuTemperature()` improved tdie detection (linus) |
| 5.9.2 | 2021-09-16 | `graohics()` (macOS), `memLayout()` (win) improvements |

View File

@ -57,6 +57,11 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">5.9.5</th>
<td>2021-10-08</td>
<td><span class="code">battery()</span> fix isCharging (windows)</td>
</tr>
<tr>
<th scope="row">5.9.4</th>
<td>2021-09-23</td>

View File

@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png">
<div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div>
<div class="version">New Version: <span id="version">5.9.4</span></div>
<div class="version">New Version: <span id="version">5.9.5</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

@ -52,7 +52,7 @@ function parseWinBatteryPart(lines, designedCapacity, fullChargeCapacity) {
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 || statusValue === 2;
result.acConnected = result.isCharging || statusValue === 2;
result.model = util.getValue(lines, 'DeviceID', '=');
} else {
result.status = -1;