Uprava cteni teploty

Uklada do promenne pouze platnou hodnotu.
master
David Zálešák 1 year ago
parent dfa8f5d05f
commit e8f284b291

@ -172,9 +172,13 @@ void thermostatCheck(){
} }
void readSensor() { void readSensor() {
float tempC = sensor.getTempCByIndex(0);
if(tempC != DEVICE_DISCONNECTED_C){
// read the actual temperature after it's been converted // read the actual temperature after it's been converted
temperature = sensor.getTempCByIndex(0) + CORRECTION; temperature = tempC + CORRECTION;
// do what you need with the temperature here // do what you need with the temperature here
}
metrics = "temp "; metrics = "temp ";
metrics += temperature; metrics += temperature;
} }