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

This commit is contained in:
csawatzky 2026-01-05 11:27:49 -06:00
parent c7d1f7ef9b
commit d9bcd07c8d

View file

@ -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
</Typography>
</Box>
</Grid>