isDue dueToTime only if sentInterval is set

This commit is contained in:
Patrick Haßel 2025-01-07 11:13:41 +01:00
parent 60c9adf677
commit 3af5f4fb90
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ public:
} }
const auto dueToNAN = isnan(currentValue) != isnan(sentValue); const auto dueToNAN = isnan(currentValue) != isnan(sentValue);
const auto dueToThreshold = abs(sentValue - currentValue) >= threshold; const auto dueToThreshold = abs(sentValue - currentValue) >= threshold;
const auto dueToTime = sentInterval != time(nullptr) / overdueSeconds; const auto dueToTime = sentInterval != 0 && sentInterval != time(nullptr) / overdueSeconds;
return dueToNAN || dueToThreshold || dueToTime; return dueToNAN || dueToThreshold || dueToTime;
} }