battery() timeremaining optimization (linux)
This commit is contained in:
parent
fc63865f33
commit
8dad45b5fa
@ -100,6 +100,7 @@ Other changes
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| -------------- | -------------- | -------- |
|
| -------------- | -------------- | -------- |
|
||||||
|
| 3.49.4 | 2018-11-21 | `battery()` timeremaining optimization (linux) thanks to Jorai Rijsdijk |
|
||||||
| 3.49.3 | 2018-11-20 | `memLayout()` optimized parsing (win) |
|
| 3.49.3 | 2018-11-20 | `memLayout()` optimized parsing (win) |
|
||||||
| 3.49.2 | 2018-11-19 | code cleanup |
|
| 3.49.2 | 2018-11-19 | code cleanup |
|
||||||
| 3.49.1 | 2018-11-19 | `cpu().brand` removed extra spaces, tabs |
|
| 3.49.1 | 2018-11-19 | `cpu().brand` removed extra spaces, tabs |
|
||||||
|
|||||||
@ -586,6 +586,7 @@ Written by Sebastian Hildebrandt [sebhildebrandt](https://github.com/sebhildebra
|
|||||||
- Jimi M [ItsJimi](https://github.com/ItsJimi)
|
- Jimi M [ItsJimi](https://github.com/ItsJimi)
|
||||||
- Git² [GitSquared](https://github.com/GitSquared)
|
- Git² [GitSquared](https://github.com/GitSquared)
|
||||||
- weiyin [weiyin](https://github.com/weiyin)
|
- weiyin [weiyin](https://github.com/weiyin)
|
||||||
|
- Jorai Rijsdijk [Erackron](https://github.com/Erackron)
|
||||||
|
|
||||||
OSX Temperature: credits here are going to:
|
OSX Temperature: credits here are going to:
|
||||||
|
|
||||||
|
|||||||
@ -70,6 +70,7 @@ module.exports = function (callback) {
|
|||||||
const percent = util.getValue(lines, 'POWER_SUPPLY_CAPACITY', '=');
|
const percent = util.getValue(lines, 'POWER_SUPPLY_CAPACITY', '=');
|
||||||
const energy = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_ENERGY_NOW', '='), 10);
|
const energy = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_ENERGY_NOW', '='), 10);
|
||||||
const power = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_POWER_NOW', '='), 10);
|
const power = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_POWER_NOW', '='), 10);
|
||||||
|
const current = parseInt('0' + util.getValue(lines, 'POWER_SUPPLY_CURRENT_NOW', '='), 10);
|
||||||
|
|
||||||
result.percent = parseInt('0' + percent, 10);
|
result.percent = parseInt('0' + percent, 10);
|
||||||
if (result.maxcapacity && result.currentcapacity) {
|
if (result.maxcapacity && result.currentcapacity) {
|
||||||
@ -83,6 +84,8 @@ module.exports = function (callback) {
|
|||||||
}
|
}
|
||||||
if (energy && power) {
|
if (energy && power) {
|
||||||
result.timeremaining = Math.floor(energy / power * 60);
|
result.timeremaining = Math.floor(energy / power * 60);
|
||||||
|
} else if (current && result.currentcapacity) {
|
||||||
|
result.timeremaining = Math.floor(result.currentcapacity / current * 60);
|
||||||
}
|
}
|
||||||
result.type = util.getValue(lines, 'POWER_SUPPLY_TECHNOLOGY', '=');
|
result.type = util.getValue(lines, 'POWER_SUPPLY_TECHNOLOGY', '=');
|
||||||
result.model = util.getValue(lines, 'POWER_SUPPLY_MODEL_NAME', '=');
|
result.model = util.getValue(lines, 'POWER_SUPPLY_MODEL_NAME', '=');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user