only use first sensor of each group for temp reporting (#2457)

This commit is contained in:
Aiden McClelland
2023-10-16 12:19:24 -06:00
committed by GitHub
parent 532ab9128f
commit edcd1a3c5b

View File

@@ -588,7 +588,8 @@ async fn get_temp() -> Result<Celsius, Error> {
.flat_map(|(_, v)| v.as_object()) .flat_map(|(_, v)| v.as_object())
.flatten() .flatten()
.filter_map(|(k, v)| { .filter_map(|(k, v)| {
if k.ends_with("_input") { // we have seen so far that `temp1` is always a composite reading of some sort, so we should just use that for each chip
if k.trim() == "temp1_input" {
v.as_f64() v.as_f64()
} else { } else {
None None