co2_sensor: Introduce states
Currently, the control flow in processData()
is determined by a mixture of
if-else
-constructes and premature return
statements,
which makes it hard to understand which case occurs when.
- Allow to log every state change to serial (default: off)
- Handle all possible LED signal states in a function
showState()
This is also some preparation to allow a neat integration of a fix for #1 (closed), which I have in preparation.
There should be no change in user-visible functionality yet.