RumPi 1.0
A self-assembling C++ sensor & actuator library for the Raspberry Pi 5
RumPi::SelectedSensorReadings Class Reference

A point-in-time copy of the SELECTED sensor readings the Home dashboard surfaces - a deliberately curated subset, not a generic per-sensor reading. More...

#include <SelectedSensorReadings.h>

Public Member Functions

 SelectedSensorReadings ()
 Builds a SelectedSensorReadings with every numeric field defaulted to NaN ("no reading / sensor not present") and the level fields defaulted to their lowest category. More...
 
virtual ~SelectedSensorReadings ()=default
 Defaulted destructor. More...
 
float GetTemperatureCelsius () const
 Gets the temperature, in Celsius. More...
 
float GetHumidityPercent () const
 Gets the relative humidity, as a percent. More...
 
float GetPmTwoPointFive () const
 Gets the PM2.5 particulate reading. More...
 
const std::string & GetAirQuality () const
 Gets the air-quality description. More...
 
float GetTVOC () const
 Gets the total volatile organic compounds (TVOC) reading. More...
 
float GetFormaldehyde () const
 Gets the formaldehyde reading. More...
 
float GetCO2 () const
 Gets the CO2 reading. More...
 
bool GetIsMotionDetected () const
 Gets whether motion was detected. More...
 
float GetWindSpeed () const
 Gets the wind speed reading. More...
 
float GetLightLux () const
 Gets the light level, in lux. More...
 
const std::string & GetLightCategory () const
 Gets the human-readable light category. More...
 
E_LightLevel GetLightLevel () const
 Gets the categorized light level. More...
 
E_AirQualityLevel GetAirQualityLevel () const
 Gets the categorized air-quality level. More...
 
void SetTemperatureCelsius (const float temperatureCelsius)
 Sets the temperature, in Celsius. More...
 
void SetHumidityPercent (const float humidityPercent)
 Sets the relative humidity, as a percent. More...
 
void SetPmTwoPointFive (const float pmTwoPointFive)
 Sets the PM2.5 particulate reading. More...
 
void SetAirQuality (const std::string &airQuality)
 Sets the air-quality description. More...
 
void SetTVOC (const float tvoc)
 Sets the total volatile organic compounds (TVOC) reading. More...
 
void SetFormaldehyde (const float formaldehyde)
 Sets the formaldehyde reading. More...
 
void SetCO2 (const float co2)
 Sets the CO2 reading. More...
 
void SetIsMotionDetected (const bool isMotionDetected)
 Sets whether motion was detected. More...
 
void SetWindSpeed (const float windSpeed)
 Sets the wind speed reading. More...
 
void SetLightLux (const float lightLux)
 Sets the light level, in lux. More...
 
void SetLightCategory (const std::string &lightCategory)
 Sets the human-readable light category. More...
 
void SetLightLevel (const E_LightLevel lightLevel)
 Sets the categorized light level. More...
 
void SetAirQualityLevel (const E_AirQualityLevel airQualityLevel)
 Sets the categorized air-quality level. More...
 

Protected Attributes

float myTemperatureCelsius
 Temperature, in Celsius (NaN if not present). More...
 
float myHumidityPercent
 Relative humidity, as a percent (NaN if not present). More...
 
float myPmTwoPointFive
 PM2.5 particulate reading (NaN if not present). More...
 
std::string myAirQuality
 Air-quality description (empty if not present). More...
 
float myTVOC
 Total volatile organic compounds reading (NaN if not present). More...
 
float myFormaldehyde
 Formaldehyde reading (NaN if not present). More...
 
float myCO2
 CO2 reading (NaN if not present). More...
 
bool myIsMotionDetected
 True if motion was detected. More...
 
float myWindSpeed
 Wind speed reading (NaN if not present). More...
 
float myLightLux
 Light level, in lux (NaN if not present). More...
 
std::string myLightCategory
 Human-readable light category (empty if not present). More...
 
E_LightLevel myLightLevel
 Categorized light level. More...
 
E_AirQualityLevel myAirQualityLevel
 Categorized air-quality level. More...
 

Detailed Description

A point-in-time copy of the SELECTED sensor readings the Home dashboard surfaces - a deliberately curated subset, not a generic per-sensor reading.

ComponentManager::GetSelectedSensorReadings() fills this on the worker thread and hands it to the UI as an immutable value, so the UI never reads a live component. Numeric fields default to NaN to mean "no reading / sensor not present" (matching the sensor getters' own convention), so a dashboard tile can show a placeholder instead of a bogus value.

Author
Eddie O'Hagan
Date
8/13/2026

Constructor & Destructor Documentation

◆ SelectedSensorReadings()

RumPi::SelectedSensorReadings::SelectedSensorReadings ( )

Builds a SelectedSensorReadings with every numeric field defaulted to NaN ("no reading / sensor not present") and the level fields defaulted to their lowest category.

Author
Eddie O'Hagan
Date
8/13/2026
SelectedSensorReadings()
Builds a SelectedSensorReadings with every numeric field defaulted to NaN ("no reading / sensor not p...
Definition: SelectedSensorReadings.cpp:17

◆ ~SelectedSensorReadings()

virtual RumPi::SelectedSensorReadings::~SelectedSensorReadings ( )
virtualdefault

Defaulted destructor.

Author
Eddie O'Hagan
Date
8/13/2026
delete readings;

Member Function Documentation

◆ GetAirQuality()

const std::string & RumPi::SelectedSensorReadings::GetAirQuality ( ) const

Gets the air-quality description.

Author
Eddie O'Hagan
Date
8/13/2026
std::string airQuality = readings.GetAirQuality();
Returns
The air-quality description, or empty if not present.

◆ GetAirQualityLevel()

E_AirQualityLevel RumPi::SelectedSensorReadings::GetAirQualityLevel ( ) const

Gets the categorized air-quality level.

Author
Eddie O'Hagan
Date
8/13/2026
E_AirQualityLevel level = readings.GetAirQualityLevel();
E_AirQualityLevel
How bad the air is, best to worst, taking whichever of PM2.5 / PM10 is worse.
Definition: SensorLevels.h:34
Returns
The categorized air-quality level.

◆ GetCO2()

float RumPi::SelectedSensorReadings::GetCO2 ( ) const

Gets the CO2 reading.

Author
Eddie O'Hagan
Date
8/13/2026
float co2 = readings.GetCO2();
Returns
The CO2 reading, or NaN if not present.

◆ GetFormaldehyde()

float RumPi::SelectedSensorReadings::GetFormaldehyde ( ) const

Gets the formaldehyde reading.

Author
Eddie O'Hagan
Date
8/13/2026
float formaldehyde = readings.GetFormaldehyde();
Returns
The formaldehyde reading, or NaN if not present.

◆ GetHumidityPercent()

float RumPi::SelectedSensorReadings::GetHumidityPercent ( ) const

Gets the relative humidity, as a percent.

Author
Eddie O'Hagan
Date
8/13/2026
float humidity = readings.GetHumidityPercent();
Returns
The relative humidity percent, or NaN if not present.

◆ GetIsMotionDetected()

bool RumPi::SelectedSensorReadings::GetIsMotionDetected ( ) const

Gets whether motion was detected.

Author
Eddie O'Hagan
Date
8/13/2026
bool motion = readings.GetIsMotionDetected();
Returns
True if motion was detected.

◆ GetLightCategory()

const std::string & RumPi::SelectedSensorReadings::GetLightCategory ( ) const

Gets the human-readable light category.

Author
Eddie O'Hagan
Date
8/13/2026
std::string category = readings.GetLightCategory();
Returns
The light category, or empty if not present.

◆ GetLightLevel()

E_LightLevel RumPi::SelectedSensorReadings::GetLightLevel ( ) const

Gets the categorized light level.

Author
Eddie O'Hagan
Date
8/13/2026
E_LightLevel level = readings.GetLightLevel();
E_LightLevel
How much light the sensor is seeing, darkest to brightest.
Definition: SensorLevels.h:17
Returns
The categorized light level.

◆ GetLightLux()

float RumPi::SelectedSensorReadings::GetLightLux ( ) const

Gets the light level, in lux.

Author
Eddie O'Hagan
Date
8/13/2026
float lux = readings.GetLightLux();
Returns
The light level in lux, or NaN if not present.

◆ GetPmTwoPointFive()

float RumPi::SelectedSensorReadings::GetPmTwoPointFive ( ) const

Gets the PM2.5 particulate reading.

Author
Eddie O'Hagan
Date
8/13/2026
float pm = readings.GetPmTwoPointFive();
Returns
The PM2.5 reading, or NaN if not present.

◆ GetTemperatureCelsius()

float RumPi::SelectedSensorReadings::GetTemperatureCelsius ( ) const

Gets the temperature, in Celsius.

Author
Eddie O'Hagan
Date
8/13/2026
float temperature = readings.GetTemperatureCelsius();
Returns
The temperature in Celsius, or NaN if not present.

◆ GetTVOC()

float RumPi::SelectedSensorReadings::GetTVOC ( ) const

Gets the total volatile organic compounds (TVOC) reading.

Author
Eddie O'Hagan
Date
8/13/2026
float tvoc = readings.GetTVOC();
Returns
The TVOC reading, or NaN if not present.

◆ GetWindSpeed()

float RumPi::SelectedSensorReadings::GetWindSpeed ( ) const

Gets the wind speed reading.

Author
Eddie O'Hagan
Date
8/13/2026
float windSpeed = readings.GetWindSpeed();
Returns
The wind speed reading, or NaN if not present.

◆ SetAirQuality()

void RumPi::SelectedSensorReadings::SetAirQuality ( const std::string &  airQuality)

Sets the air-quality description.

Author
Eddie O'Hagan
Date
8/13/2026
readings.SetAirQuality("Good");
Parameters
[in]airQualityThe air-quality description to set.

◆ SetAirQualityLevel()

void RumPi::SelectedSensorReadings::SetAirQualityLevel ( const E_AirQualityLevel  airQualityLevel)

Sets the categorized air-quality level.

Author
Eddie O'Hagan
Date
8/13/2026
readings.SetAirQualityLevel(E_AirQualityLevel::AIR_QUALITY_GOOD);
Parameters
[in]airQualityLevelThe categorized air-quality level to set.

◆ SetCO2()

void RumPi::SelectedSensorReadings::SetCO2 ( const float  co2)

Sets the CO2 reading.

Author
Eddie O'Hagan
Date
8/13/2026
readings.SetCO2(420.0f);
Parameters
[in]co2The CO2 reading to set.

◆ SetFormaldehyde()

void RumPi::SelectedSensorReadings::SetFormaldehyde ( const float  formaldehyde)

Sets the formaldehyde reading.

Author
Eddie O'Hagan
Date
8/13/2026
readings.SetFormaldehyde(0.03f);
Parameters
[in]formaldehydeThe formaldehyde reading to set.

◆ SetHumidityPercent()

void RumPi::SelectedSensorReadings::SetHumidityPercent ( const float  humidityPercent)

Sets the relative humidity, as a percent.

Author
Eddie O'Hagan
Date
8/13/2026
readings.SetHumidityPercent(45.0f);
Parameters
[in]humidityPercentThe relative humidity to set, as a percent.

◆ SetIsMotionDetected()

void RumPi::SelectedSensorReadings::SetIsMotionDetected ( const bool  isMotionDetected)

Sets whether motion was detected.

Author
Eddie O'Hagan
Date
8/13/2026
readings.SetIsMotionDetected(true);
Parameters
[in]isMotionDetectedTrue if motion was detected.

◆ SetLightCategory()

void RumPi::SelectedSensorReadings::SetLightCategory ( const std::string &  lightCategory)

Sets the human-readable light category.

Author
Eddie O'Hagan
Date
8/13/2026
readings.SetLightCategory("Bright");
Parameters
[in]lightCategoryThe light category to set.

◆ SetLightLevel()

void RumPi::SelectedSensorReadings::SetLightLevel ( const E_LightLevel  lightLevel)

Sets the categorized light level.

Author
Eddie O'Hagan
Date
8/13/2026
readings.SetLightLevel(E_LightLevel::LIGHT_BRIGHT);
Parameters
[in]lightLevelThe categorized light level to set.

◆ SetLightLux()

void RumPi::SelectedSensorReadings::SetLightLux ( const float  lightLux)

Sets the light level, in lux.

Author
Eddie O'Hagan
Date
8/13/2026
readings.SetLightLux(250.0f);
Parameters
[in]lightLuxThe light level to set, in lux.

◆ SetPmTwoPointFive()

void RumPi::SelectedSensorReadings::SetPmTwoPointFive ( const float  pmTwoPointFive)

Sets the PM2.5 particulate reading.

Author
Eddie O'Hagan
Date
8/13/2026
readings.SetPmTwoPointFive(12.0f);
Parameters
[in]pmTwoPointFiveThe PM2.5 reading to set.

◆ SetTemperatureCelsius()

void RumPi::SelectedSensorReadings::SetTemperatureCelsius ( const float  temperatureCelsius)

Sets the temperature, in Celsius.

Author
Eddie O'Hagan
Date
8/13/2026
readings.SetTemperatureCelsius(21.5f);
Parameters
[in]temperatureCelsiusThe temperature to set, in Celsius.

◆ SetTVOC()

void RumPi::SelectedSensorReadings::SetTVOC ( const float  tvoc)

Sets the total volatile organic compounds (TVOC) reading.

Author
Eddie O'Hagan
Date
8/13/2026
readings.SetTVOC(0.5f);
Parameters
[in]tvocThe TVOC reading to set.

◆ SetWindSpeed()

void RumPi::SelectedSensorReadings::SetWindSpeed ( const float  windSpeed)

Sets the wind speed reading.

Author
Eddie O'Hagan
Date
8/13/2026
readings.SetWindSpeed(3.2f);
Parameters
[in]windSpeedThe wind speed reading to set.

Member Data Documentation

◆ myAirQuality

std::string RumPi::SelectedSensorReadings::myAirQuality
protected

Air-quality description (empty if not present).

◆ myAirQualityLevel

E_AirQualityLevel RumPi::SelectedSensorReadings::myAirQualityLevel
protected

Categorized air-quality level.

◆ myCO2

float RumPi::SelectedSensorReadings::myCO2
protected

CO2 reading (NaN if not present).

◆ myFormaldehyde

float RumPi::SelectedSensorReadings::myFormaldehyde
protected

Formaldehyde reading (NaN if not present).

◆ myHumidityPercent

float RumPi::SelectedSensorReadings::myHumidityPercent
protected

Relative humidity, as a percent (NaN if not present).

◆ myIsMotionDetected

bool RumPi::SelectedSensorReadings::myIsMotionDetected
protected

True if motion was detected.

◆ myLightCategory

std::string RumPi::SelectedSensorReadings::myLightCategory
protected

Human-readable light category (empty if not present).

◆ myLightLevel

E_LightLevel RumPi::SelectedSensorReadings::myLightLevel
protected

Categorized light level.

◆ myLightLux

float RumPi::SelectedSensorReadings::myLightLux
protected

Light level, in lux (NaN if not present).

◆ myPmTwoPointFive

float RumPi::SelectedSensorReadings::myPmTwoPointFive
protected

PM2.5 particulate reading (NaN if not present).

◆ myTemperatureCelsius

float RumPi::SelectedSensorReadings::myTemperatureCelsius
protected

Temperature, in Celsius (NaN if not present).

◆ myTVOC

float RumPi::SelectedSensorReadings::myTVOC
protected

Total volatile organic compounds reading (NaN if not present).

◆ myWindSpeed

float RumPi::SelectedSensorReadings::myWindSpeed
protected

Wind speed reading (NaN if not present).


The documentation for this class was generated from the following files: