From 530950ed8a7bd719448561e8480ca00b2e0afb69 Mon Sep 17 00:00:00 2001 From: Marco Hauswirth Date: Mon, 22 Jul 2024 19:01:26 +0200 Subject: [PATCH] set best sensor to -1 after last sensor fails --- src/modules/sensors/data_validator/DataValidatorGroup.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/sensors/data_validator/DataValidatorGroup.cpp b/src/modules/sensors/data_validator/DataValidatorGroup.cpp index a7ded78d26cb..eabf61788ca4 100644 --- a/src/modules/sensors/data_validator/DataValidatorGroup.cpp +++ b/src/modules/sensors/data_validator/DataValidatorGroup.cpp @@ -230,6 +230,10 @@ float *DataValidatorGroup::get_best(uint64_t timestamp, int *index) if (_first_failover_time == 0) { _first_failover_time = timestamp; } + + if (max_confidence < FLT_EPSILON) { + max_index = -1; + } } }