Commit 239daba6 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 c6139baf
...@@ -291,7 +291,9 @@ namespace sensor { ...@@ -291,7 +291,9 @@ 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