Commit c91a8491 authored by Käppler's avatar Käppler
Browse files

co2_sensor: Do not report new data in all cases

Log every measurement to the serial console, but
return only `true` in `processData()`(thus starting
further processing like CSV, MQTT, LORAWAN) if
the data is reliable (stable measurements, CO2 > 0)
or the sensor measures too low CO2 values (< 250).

The latter condition should be reported, because
the user can then initiate a manual calibration procedure.
parent 67578525
Pipeline #3294 passed with stage
in 1 minute and 49 seconds
...@@ -289,8 +289,10 @@ namespace sensor { ...@@ -289,8 +289,10 @@ namespace sensor {
} }
showState(); showState();
return freshData; // Report data for further processing only if the data is reliable
// (state 'READY') or manual calibration is necessary (state 'NEEDS_CALIBRATION').
return freshData && (current_state == READY || current_state == NEEDS_CALIBRATION);
} }
/***************************************************************** /*****************************************************************
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment