systeminformation 5.21.7 → 5.21.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/battery.js +3 -0
  2. package/package.json +1 -1
package/lib/battery.js CHANGED
@@ -127,6 +127,7 @@ module.exports = function (callback) {
127
127
  const energy = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_ENERGY_NOW', '='), 10);
128
128
  const power = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_POWER_NOW', '='), 10);
129
129
  const current = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_CURRENT_NOW', '='), 10);
130
+ const charge = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_CHARGE_NOW', '='), 10);
130
131
 
131
132
  result.percent = parseInt('0' + percent, 10);
132
133
  if (result.maxCapacity && result.currentCapacity) {
@@ -140,6 +141,8 @@ module.exports = function (callback) {
140
141
  }
141
142
  if (energy && power) {
142
143
  result.timeRemaining = Math.floor(energy / power * 60);
144
+ } else if (current && charge) {
145
+ result.timeRemaining = Math.floor(charge / current * 60);
143
146
  } else if (current && result.currentCapacity) {
144
147
  result.timeRemaining = Math.floor(result.currentCapacity / current * 60);
145
148
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.21.7",
3
+ "version": "5.21.8",
4
4
  "description": "Advanced, lightweight system and OS information library",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",