OzWrapper.OzCO.OzCO¶
Carbon monoxide (CO) sensor wrapper for the Oizom edge stack.
This module exposes the OzCO wrapper, which adapts an
electrochemical or NDIR carbon monoxide sensor driver to the unified
sensor contract defined by SensorBase.SensorBase.GenericSensor.
It is responsible for initialising CO sensors declared in the Gateway
configuration, sampling instantaneous CO concentrations (in ppm, or
ppb depending on hardware scaling), accumulating samples between
publish cycles, and finally emitting calibration-corrected averages
back to the data pipeline.
The current implementation is a stub: OzCO.getCO() returns a
hardcoded test value so the surrounding plumbing (initialisation,
accumulation, averaging, sensitivity and correction offsets) can be
exercised end-to-end before the physical sensor driver is wired in.
Example
>>> from OzWrapper.OzCO.OzCO import OzCO
>>> co = OzCO()
>>> co.initialize(gateway_sensor_config)
>>> co.getSensorReading()
{'co': 86.23}
>>> out = {}
>>> co.putSensorValue(out)
{'co': 86.23}
Note
The hardware driver hookup is pending. Replace the body of
OzCO.getCO() with the real ADC / I2C / UART read once the
CO sensor (part number 86) firmware integration is finalised.
The wrapper is otherwise ready for production use because it
already honours the SensorBase.SensorBase.GenericSensor
initialise / read / publish lifecycle expected by the Gateway.
Classes¶
Carbon monoxide (CO) sensor wrapper exposing the GenericSensor API. |