bugfix cpuTemperature() - max value on windows

This commit is contained in:
Sebastian Hildebrandt
2017-10-03 09:32:30 +02:00
parent 098aba023c
commit e677113bdf
3 changed files with 7 additions and 4 deletions
+5 -3
View File
@@ -366,11 +366,13 @@ function cpuTemperature(callback) {
let sum = 0;
let lines = stdout.trim().split(/\s\s+/);
lines.forEach(function (line) {
if (line.match('CriticalTripPoint') && !result.max)
result.max = (parseInt(line.split('CriticalTripPoint=')[1]) - 2732) / 10;
else if (line.match('CurrentTemperature')) {
// if (line.match('CriticalTripPoint') && result.max === -1)
// result.max = (parseInt(line.split('CriticalTripPoint=')[1]) - 2732) / 10;
// else
if (line.match('CurrentTemperature')) {
let value = (parseInt(line.split('CurrentTemperature=')[1]) - 2732) / 10;
sum = sum + value;
if (value > result.max) result.max = value;
result.cores.push(value);
}
});