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 val;
let useEMC = false; let useEMC = false;
switch (valDisplay) { //taking the switch cases out so that the node always displays the average for the moisture/humidity
case "average": if (average?.emc) {
if (average?.emc) { useEMC = true;
useEMC = true; val = average.emc;
val = average.emc; } else {
} else { val = average?.humid;
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;
} }
// 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)) { if (val !== undefined && !isNaN(val)) {
display = val.toFixed(2); display = val.toFixed(2);
@ -332,7 +339,8 @@ export default function BinCard(props: Props) {
color="textSecondary" color="textSecondary"
noWrap noWrap
style={{ fontSize: "0.5rem" }}> style={{ fontSize: "0.5rem" }}>
{valDisplay === "high" ? "High" : valDisplay === "low" ? "Low" : "Average"} {/* {valDisplay === "high" ? "High" : valDisplay === "low" ? "Low" : "Average"} */}
Average
</Typography> </Typography>
</Box> </Box>
</Grid> </Grid>