From 5f2beb701bfc2462e55c305c5cedec9722f26776 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Tue, 12 May 2020 16:00:02 +0200 Subject: [PATCH] getAllData() added wifiNetworks --- lib/cpu.js | 2 +- lib/index.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) mode change 100644 => 100755 lib/index.js diff --git a/lib/cpu.js b/lib/cpu.js index c532c57..f002a1f 100644 --- a/lib/cpu.js +++ b/lib/cpu.js @@ -767,7 +767,7 @@ function cpuTemperature(callback) { for (let i = 0; i < temps.length; i++) { if (temps[i] && (labels[i] === undefined || (labels[i] && labels[i].toLowerCase().startsWith('core')))) { result.cores.push(Math.round(parseInt(temps[i], 10) / 100) / 10); - } else if (temps[i] && labels[i] && result.main === -1) { + } else if (temps[i] && labels[i] && result.main === -1) { result.main = Math.round(parseInt(temps[i], 10) / 100) / 10; } } diff --git a/lib/index.js b/lib/index.js old mode 100644 new mode 100755 index ac6ffff..3cb9205 --- a/lib/index.js +++ b/lib/index.js @@ -140,8 +140,8 @@ function getDynamicData(srv, iface, callback) { // use closure to track ƒ completion let functionProcessed = (function () { - let totalFunctions = 14; - if (_windows) totalFunctions = 10; + let totalFunctions = 15; + if (_windows) totalFunctions = 11; if (_freebsd || _openbsd || _netbsd) totalFunctions = 11; if (_sunos) totalFunctions = 6; @@ -260,6 +260,13 @@ function getDynamicData(srv, iface, callback) { }); } + if (!_openbsd && !_freebsd && !_netbsd && !_sunos) { + wifi.wifiNetworks().then(res => { + data.wifiNetworks = res; + functionProcessed(); + }); + } + internet.inetLatency().then(res => { data.inetLatency = res; functionProcessed();