From fb19ca8bf4fc8f8b54c15e57d9489e8320581fac Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Thu, 3 Mar 2022 11:14:28 +0100 Subject: [PATCH] Regression fix. --- usermods/Temperature/usermod_temperature.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/usermods/Temperature/usermod_temperature.h b/usermods/Temperature/usermod_temperature.h index 04b967af8..09ffc2596 100644 --- a/usermods/Temperature/usermod_temperature.h +++ b/usermods/Temperature/usermod_temperature.h @@ -98,16 +98,9 @@ class UsermodTemperature : public Usermod { } void readTemperature() { - float newTemp = readDallas(); + temperature = readDallas(); + lastMeasurement = millis(); waitingForConversion = false; - if (temperature > -100.f && abs(newTemp-temperature)>10.) { - lastMeasurement = millis() - readingInterval + 5000; // speed up next reading - errorReading = true; - } else { - lastMeasurement = millis(); - errorReading = false; - temperature = newTemp; - } //DEBUG_PRINTF("Read temperature %2.1f.\n", temperature); // does not work properly on 8266 DEBUG_PRINT(F("Read temperature ")); DEBUG_PRINTLN(temperature); @@ -243,7 +236,7 @@ class UsermodTemperature : public Usermod { return; } - temp.add(degC ? temperature : (float)temperature * 1.8f + 32); + temp.add(degC ? getTemperatureC() : getTemperatureF()); temp.add(degC ? F("°C") : F("°F")); JsonObject sensor = root[F("sensor")];