From 61ceb8b68acd2bbc072125c078dae82b474f99ad Mon Sep 17 00:00:00 2001 From: JHale716 Date: Tue, 4 Jun 2019 23:04:24 +1200 Subject: [PATCH] Update MMM-SystemStats.js Experiencing an additional CR in the data returned from sensors, two identical systems running the code, one has the CR the other doesn't. --- MMM-SystemStats.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MMM-SystemStats.js b/MMM-SystemStats.js index 1c5d029..f511c68 100644 --- a/MMM-SystemStats.js +++ b/MMM-SystemStats.js @@ -60,6 +60,8 @@ Module.register('MMM-SystemStats', { //Log.log(payload); if (notification === 'STATS') { this.stats.cpuTemp = payload.cpuTemp; + // remove space/CR from data returned for cpu on the intel, seems inconsistent, two systems one has the CR the other doesn't + this.stats.cpuTemp = this.stats.cpuTemp.replace(/[\n\r]+/g, ""); //console.log("this.config.useSyslog-" + this.config.useSyslog + ', this.stats.cpuTemp-'+parseInt(this.stats.cpuTemp)+', this.config.thresholdCPUTemp-'+this.config.thresholdCPUTemp); if (this.config.useSyslog) { var cpuTemp = Math.ceil(parseFloat(this.stats.cpuTemp));