Skip to content

Commit

Permalink
Fixed Gauge tiles daily reset (via MQTT)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daveiano committed Nov 17, 2023
1 parent 8b6a609 commit a0157e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
24 changes: 2 additions & 22 deletions skins/weewx-wdc/src/js/diagrams/d3/gauge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,32 +109,17 @@ export const D3GaugeDiagram: FunctionComponent<GaugeDiagramBaseProps> = (
// 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));
}

Expand Down Expand Up @@ -689,11 +674,6 @@ export const D3GaugeDiagram: FunctionComponent<GaugeDiagramBaseProps> = (
-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 (
Expand Down

0 comments on commit a0157e7

Please sign in to comment.