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

@ -44,7 +44,7 @@ public:
uint64_t address; uint64_t address;
for (int index = 0; index < count; ++index) { for (int index = 0; index < count; ++index) {
sensors.getAddress(reinterpret_cast<uint8_t *>(&address), index); sensors.getAddress(reinterpret_cast<uint8_t *>(&address), index);
info("Dallas %d/%d 0x%016llX = %5.1f ^C", index + 1, count, address, sensors.getTempC(reinterpret_cast<uint8_t *>(&address))); info("Dallas %d/%d 0x%016llX = %5.1f^C", index + 1, count, address, sensors.getTempC(reinterpret_cast<uint8_t *>(&address)));
} }
} else { } else {
warn("No Dallas devices found!"); warn("No Dallas devices found!");

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;
} }