diff --git a/ESPtermostat.ino b/ESPtermostat.ino index 783f9f1..fbea8ff 100644 --- a/ESPtermostat.ino +++ b/ESPtermostat.ino @@ -172,9 +172,13 @@ void thermostatCheck(){ } void readSensor() { + float tempC = sensor.getTempCByIndex(0); + + if(tempC != DEVICE_DISCONNECTED_C){ // 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 + } metrics = "temp "; metrics += temperature; }