From d9bcd07c8dbfda98946a2c0306374dd7470d1ed7 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Mon, 5 Jan 2026 11:27:49 -0600 Subject: [PATCH] changing the humidity/moisture part of the bin card to only display the average and the high, low, average selector only changes the temp part --- src/bin/BinCardV2.tsx | 60 ++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/src/bin/BinCardV2.tsx b/src/bin/BinCardV2.tsx index a4afc33..776af57 100644 --- a/src/bin/BinCardV2.tsx +++ b/src/bin/BinCardV2.tsx @@ -261,32 +261,39 @@ export default function BinCard(props: Props) { let val; let useEMC = false; - switch (valDisplay) { - case "average": - if (average?.emc) { - useEMC = true; - val = average.emc; - } else { - val = average?.humid; - } - break; - case "low": - if (coldNode?.emc) { - useEMC = true; - val = coldNode.emc; - } else { - val = coldNode?.humid; - } - break; - case "high": - if (hotNode?.emc) { - useEMC = true; - val = hotNode.emc; - } else { - val = hotNode?.humid; - } - break; + //taking the switch cases out so that the node always displays the average for the moisture/humidity + if (average?.emc) { + useEMC = true; + val = average.emc; + } else { + val = average?.humid; } + // switch (valDisplay) { + // case "average": + // if (average?.emc) { + // useEMC = true; + // val = average.emc; + // } else { + // val = average?.humid; + // } + // break; + // case "low": + // if (coldNode?.emc) { + // useEMC = true; + // val = coldNode.emc; + // } else { + // val = coldNode?.humid; + // } + // break; + // case "high": + // if (hotNode?.emc) { + // useEMC = true; + // val = hotNode.emc; + // } else { + // val = hotNode?.humid; + // } + // break; + // } if (val !== undefined && !isNaN(val)) { display = val.toFixed(2); @@ -332,7 +339,8 @@ export default function BinCard(props: Props) { color="textSecondary" noWrap style={{ fontSize: "0.5rem" }}> - {valDisplay === "high" ? "High" : valDisplay === "low" ? "Low" : "Average"} + {/* {valDisplay === "high" ? "High" : valDisplay === "low" ? "Low" : "Average"} */} + Average