pi_weather.core.managers.stcc4_service module¶
- class pi_weather.core.managers.stcc4_service.STCC4Service[source]¶
Bases:
objectSTCC4 sensor service class
- static _is_sensor_enabled()[source]¶
Function to check whether current sensor is enabled or disabled from the docker-compose.yaml
- Returns:
True if STCC4 sensor is enabled, False otherwise
- Return type:
- get_latest()[source]¶
Function to get the latest sensor reading
- Returns:
Latest sensor data read by the sensor
- Return type:
- _update_metrics(co2, t, h, sensor_status, et, air_quality)[source]¶
Function to update Prometheus metrics
- _save_latest_reading(co2, t, h, sensor_status, et, air_quality)[source]¶
Function to record/save the latest sensor reading
- _read_sensor_data()[source]¶
Function to read sensor data This method will record the latest reading + update Prometheus metrics
- Returns:
Nothing
- Return type:
- _log_new_data(co2, t, h, sensor_status, et, air_quality)[source]¶
Function to correctly log the new data read (regardless the data acquisition mode