diff --git a/code/espurna/sensor.cpp b/code/espurna/sensor.cpp index 971b8e7b..76cb49a7 100644 --- a/code/espurna/sensor.cpp +++ b/code/espurna/sensor.cpp @@ -4219,9 +4219,6 @@ bool ready_to_report(ValuePair& out, const ValuePair& processed, const Magnitude const bool check_max_threshold { !std::isnan(magnitude.max_threshold) }; report = report || check_max_threshold; - // Figure out whether report value is zero or not - const bool check_zero_threshold { !std::isnan(magnitude.zero_threshold) }; - report = report || check_zero_threshold; if (report) { if (magnitude.filter->ready()) { @@ -4234,7 +4231,8 @@ bool ready_to_report(ValuePair& out, const ValuePair& processed, const Magnitude out = processed; } - if (check_zero_threshold && out.value < magnitude.zero_threshold) { + // Figure out whether report value should be zero or not + if (!std::isnan(magnitude.zero_threshold) && out.value < magnitude.zero_threshold) { out.value = 0.0; }