From b336b5aad290b169ede5ccd43732d857b79e1979 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Tue, 9 Aug 2022 06:49:08 +0200 Subject: [PATCH] cpuTemperature() fix main (linux) --- CHANGELOG.md | 1 + docs/history.html | 5 +++++ docs/index.html | 2 +- lib/cpu.js | 12 ++++++------ lib/network.js | 1 - 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72bbc22..bac431b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 5.12.4 | 2022-08-09 | `cpuTemperature()` fix main (linux) | | 5.12.3 | 2022-08-04 | `networkInterfaces()` operstate fix (mac OS) | | 5.12.2 | 2022-08-01 | `services()` Ubuntu 22.04 fix | | 5.12.1 | 2022-07-14 | `cpuTemperature()` Apple Silicon support (see docs) | diff --git a/docs/history.html b/docs/history.html index a0925ce..8fecc4c 100644 --- a/docs/history.html +++ b/docs/history.html @@ -57,6 +57,11 @@ + + 5.12.4 + 2022-08-09 + cpuTemperture() fix main (linux) + 5.12.3 2022-08-04 diff --git a/docs/index.html b/docs/index.html index 462f270..12d5bc0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.12.3
+
New Version: 5.12.4
diff --git a/lib/cpu.js b/lib/cpu.js index a87ee3e..b91c5aa 100644 --- a/lib/cpu.js +++ b/lib/cpu.js @@ -1066,9 +1066,9 @@ function cpuTemperature(callback) { }); if (result.cores.length > 0) { - if (result.main === null) { - result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length); - } + // if (result.main === null) { + result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length); + // } let maxtmp = Math.max.apply(Math, result.cores); result.max = (maxtmp > result.main) ? maxtmp : result.main; } @@ -1122,9 +1122,9 @@ function cpuTemperature(callback) { } }); if (result.cores.length > 0) { - if (result.main === null) { - result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length); - } + // if (result.main === null) { + result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length); + // } let maxtmp = Math.max.apply(Math, result.cores); result.max = (maxtmp > result.main) ? maxtmp : result.main; } else { diff --git a/lib/network.js b/lib/network.js index ec051be..78a3ad7 100644 --- a/lib/network.js +++ b/lib/network.js @@ -496,7 +496,6 @@ function parseLinesDarwinNics(sections) { nic.type = util.getValue(section, 'type').toLowerCase().indexOf('wi-fi') > -1 ? 'wireless' : 'wired'; const operstate = util.getValue(section, 'status').toLowerCase(); nic.operstate = (operstate === 'active' ? 'up' : (operstate === 'inactive' ? 'down' : 'unknown')); - // nic.operstate = util.getValue(section, 'status').toLowerCase().indexOf('active') > -1 ? 'up' : 'down'; nic.duplex = util.getValue(section, 'media').toLowerCase().indexOf('half-duplex') > -1 ? 'half' : 'full'; if (nic.ip6 || nic.ip4 || nic.mac) { nics.push(nic);