From e42f1a3fb08fe702673ebfab6db6b1cbee71dd43 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Wed, 28 Jan 2026 14:59:32 -0600 Subject: [PATCH] updated the gate page to use the pca state in the gates status for the lights on the visualizer and the pca fan on/off, this also allows me to get rid of setting those base on the data loaded for the graph which will fix the bug where the light could change based on what date range you loaded --- src/gate/GateDevice.tsx | 28 ++++++++++++++-------------- src/gate/GateFlowGraph.tsx | 24 ++++++++++++------------ src/gate/GateGraphs.tsx | 10 +++++----- src/gate/GateSVG.tsx | 30 ++++++++++++++++++++---------- src/pages/Gate.tsx | 2 +- 5 files changed, 52 insertions(+), 42 deletions(-) diff --git a/src/gate/GateDevice.tsx b/src/gate/GateDevice.tsx index 63ec92c..bfc1641 100644 --- a/src/gate/GateDevice.tsx +++ b/src/gate/GateDevice.tsx @@ -51,8 +51,8 @@ export default function GateDevice(props: Props) { const [interactionDialog, setInteractionDialog] = useState(false); const [densityTemp, setDensityTemp] = useState(0); const isMobile = useMobile(); - const [pcaState, setPCAState] = useState(false); - const [pcaFanOn, setPCAFanOn] = useState(false); + // const [pcaState, setPCAState] = useState(false); + // const [pcaFanOn, setPCAFanOn] = useState(false); const [detail, setDetail] = useState<"sensors" | "analytics">("analytics"); const [lastAmbient, setLastAmbient] = useState(0); const [lastTemps, setLastTemps] = useState({ t1: 0, t2: 0 }); @@ -99,13 +99,13 @@ export default function GateDevice(props: Props) { break; case pond.GateComponentType.GATE_COMPONENT_TYPE_PRESSURE: setPressureKey(c.key()); - if ( - c.status.measurement[0] && - c.status.measurement[0].values[0] && - c.status.measurement[0].values[0].values[1] - ) { - setPCAFanOn(c.status.measurement[0].values[0].values[1] > 996); //apx 4 iwg - } + // if ( + // c.status.measurement[0] && + // c.status.measurement[0].values[0] && + // c.status.measurement[0].values[0].values[1] + // ) { + // setPCAFanOn(c.status.measurement[0].values[0].values[1] > 996); //apx 4 iwg + // } break; default: // type is unknown, do nothing @@ -345,8 +345,8 @@ export default function GateDevice(props: Props) { ambientSelector={ambientSelector} tempChainSelector={tempSelector} pressureChainSelector={pressureSelector} - pcaState={pcaState} - pcaFanState={pcaFanOn} + pcaState={gate.status.pcaState} + // pcaFanState={pcaFanOn} checkInTime={device.status.lastActive} />