From a0157e73a71e12a676637bf5a32d85ab2b658d72 Mon Sep 17 00:00:00 2001 From: David Baetge Date: Sat, 18 Nov 2023 00:57:28 +0100 Subject: [PATCH] Fixed Gauge tiles daily reset (via MQTT) --- changelog.md | 1 + skins/weewx-wdc/src/js/diagrams/d3/gauge.tsx | 24 ++------------------ 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/changelog.md b/changelog.md index bdfdfb4..e58d9d8 100644 --- a/changelog.md +++ b/changelog.md @@ -750,3 +750,4 @@ See https://github.com/Daveiano/weewx-wdc/compare/v3.3.0...580071ca175a03fe4924b - Bugfix: Fixed "ValueError: could not convert string to float" in forecast, introduced in GH-191 - Bugfixed Added missing `nl.conf` in `install.py` GH-221 +- Bugfix: Fixed Gauge tiles daily reset (via MQTT) diff --git a/skins/weewx-wdc/src/js/diagrams/d3/gauge.tsx b/skins/weewx-wdc/src/js/diagrams/d3/gauge.tsx index dd341f0..c4987ab 100644 --- a/skins/weewx-wdc/src/js/diagrams/d3/gauge.tsx +++ b/skins/weewx-wdc/src/js/diagrams/d3/gauge.tsx @@ -109,32 +109,17 @@ export const D3GaugeDiagram: FunctionComponent = ( // TODO: dayChange handling. const gaugeProxy = new Proxy(gaugeData, { set: function (target, key, value) { - //console.log(`${String(key)} set to ${value}`); target[key] = value; - console.log(`Set ${String(key)} to ${value}`); - - if (target.dayChange) { - console.log("dayChange gauge"); - } - - console.log(target); - if (String(key) === "current") { setCurrent(parseFloat(value)); } - if ( - String(key) === "min" && - (parseFloat(value) < min || target.dayChange) - ) { + if (String(key) === "min") { setMin(parseFloat(value)); } - if ( - String(key) === "max" && - (parseFloat(value) > max || target.dayChange) - ) { + if (String(key) === "max") { setMax(parseFloat(value)); } @@ -689,11 +674,6 @@ export const D3GaugeDiagram: FunctionComponent = ( -gaugeContainerDimensions.y + margin })` ); - - console.log("obs", props.obs); - console.log("current", current); - console.log("min", min); - console.log("max", max); }, [current, min, max, darkMode, dimensions]); return (