fix: polling ntc on esp8266 fixed

This commit is contained in:
Yurii
2024-11-09 17:41:39 +03:00
parent e71f3868fd
commit fcf7d61ca5

View File

@@ -361,7 +361,12 @@ protected:
continue;
}
#ifdef ARDUINO_ARCH_ESP32
const auto value = analogReadMilliVolts(sSensor.gpio);
#else
const auto value = analogRead(sSensor.gpio) / 1023 * DEFAULT_NTC_VREF;
#endif
if (value < DEFAULT_NTC_VLOW_TRESHOLD) {
if (Sensors::getConnectionStatusById(sensorId)) {
Sensors::setConnectionStatusById(sensorId, false, false);