diff --git a/lib/patrix/sensors/DallasSensor.h b/lib/patrix/sensors/DallasSensor.h index 6fcc3c9..4181f98 100644 --- a/lib/patrix/sensors/DallasSensor.h +++ b/lib/patrix/sensors/DallasSensor.h @@ -54,7 +54,7 @@ public: const double value = sensors.read(address); const time_t timestamp = sensors.getTimestamp(); const unsigned long millisNow = millis(); - const bool doPublish = !isnan(value) && (abs(lastSentValue - value) >= valueThreshold || millisNow - lastSentMillis >= minIntervalMillis); + const bool doPublish = !isnan(value) && (isnan(lastSentValue) || abs(lastSentValue - value) >= valueThreshold || millisNow - lastSentMillis >= minIntervalMillis); if (doPublish) { lastSentValue = value; lastSentMillis = millisNow;