Skip to content

Commit

Permalink
Merge pull request #205 from melkati/fixOffset
Browse files Browse the repository at this point in the history
Add internal temperature offset initialization and retrieval methods
  • Loading branch information
hpsaturn authored Feb 27, 2024
2 parents 622ff0b + cbb19df commit 2882fca
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
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

0 comments on commit 2882fca

Please sign in to comment.