temperaturesensor-bugfix #47
@ -142,7 +142,7 @@ class TemperatureSensor : public AbstractTemperatureSensor {
|
||||
|
||||
deltaTime = (uptime.tv_sec + uptime.tv_usec / 1000000.) -
|
||||
(uptimeOfOldTemperature.tv_sec + uptimeOfOldTemperature.tv_usec / 1000000.);
|
||||
deltaTemp = oldTemperature - outputTemperature;
|
||||
deltaTemp = oldTemperature - outputTemperature.value;
|
||||
if (deltaTemp < 0) {
|
||||
deltaTemp = -deltaTemp;
|
||||
}
|
||||
@ -160,13 +160,13 @@ class TemperatureSensor : public AbstractTemperatureSensor {
|
||||
outputTemperature.setValid(PoolVariableIF::INVALID);
|
||||
outputTemperature = thermal::INVALID_TEMPERATURE;
|
||||
} else {
|
||||
oldTemperature = outputTemperature;
|
||||
oldTemperature = outputTemperature.value;
|
||||
uptimeOfOldTemperature = uptime;
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
float getTemperature() { return outputTemperature; }
|
||||
float getTemperature() { return outputTemperature.value; }
|
||||
|
||||
bool isValid() { return outputTemperature.isValid(); }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user