cpuTemperature() bugfix parsing negative values
This commit is contained in:
parent
7f25037d21
commit
e58df61e47
@ -100,6 +100,7 @@ Other changes
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| -------------- | -------------- | -------- |
|
| -------------- | -------------- | -------- |
|
||||||
|
| 3.42.4 | 2018-07-09 | `cpuTemperature()` bugfix parsing negative values |
|
||||||
| 3.42.3 | 2018-07-05 | `services()` bugfix not finding services with capital letters |
|
| 3.42.3 | 2018-07-05 | `services()` bugfix not finding services with capital letters |
|
||||||
| 3.42.2 | 2018-07-03 | `users()` optimized results if lack of permissions |
|
| 3.42.2 | 2018-07-03 | `users()` optimized results if lack of permissions |
|
||||||
| 3.42.1 | 2018-07-03 | `versions()` bugfix git version macOS |
|
| 3.42.1 | 2018-07-03 | `versions()` bugfix git version macOS |
|
||||||
|
|||||||
@ -462,7 +462,7 @@ function cpuTemperature(callback) {
|
|||||||
if (!error) {
|
if (!error) {
|
||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
lines.forEach(function (line) {
|
lines.forEach(function (line) {
|
||||||
let regex = /\+([^°]*)/g;
|
let regex = /[+-]([^°]*)/g;
|
||||||
let temps = line.match(regex);
|
let temps = line.match(regex);
|
||||||
if (line.split(':')[0].toUpperCase().indexOf('PHYSICAL') !== -1) {
|
if (line.split(':')[0].toUpperCase().indexOf('PHYSICAL') !== -1) {
|
||||||
result.main = parseFloat(temps);
|
result.main = parseFloat(temps);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user