Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add internal temperature offset initialization and retrieval methods #205

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/Sensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,21 @@ void Sensors::tempRegister(bool isCO2temp) {
}
}

/**
* @brief Initialize internal temperature offset to be used on startup
*
* Positive value for offset to be subtracetd to the temperature.
* Mush be called before the initialization of the sensors.
*/
void Sensors::initTOffset(float offset) { toffset = offset; }

/**
* @brief Get sensorlib actual internal temperature offset
* @return float with the temperature offset.
* Positive value for offset to be subtracetd to the temperature.
*/
float Sensors::getTOffset() { return toffset; }

/**
* @brief Set temperature offset for all temperature sensors
*
Expand Down
4 changes: 4 additions & 0 deletions src/Sensors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ class Sensors {

float getGeigerMicroSievertHour(void);

void initTOffset(float offset);

float getTOffset();

void setTempOffset(float offset);

float getTempOffset();
Expand Down
Loading