From b169cae91f84c96dd24fe344b13db8fbdc6d394f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Bo=CC=88hm?= Date: Wed, 15 Jan 2025 18:16:28 +0100 Subject: [PATCH] fix data age validation --- src/solarcharger/mqtt/Stats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solarcharger/mqtt/Stats.cpp b/src/solarcharger/mqtt/Stats.cpp index e86048a5c..e2455ce9f 100644 --- a/src/solarcharger/mqtt/Stats.cpp +++ b/src/solarcharger/mqtt/Stats.cpp @@ -43,7 +43,7 @@ void Stats::setOutputCurrent(const float current) { std::optional Stats::getValueIfNotOutdated(const uint32_t lastUpdate, const float value) const { // never updated or older than 60 seconds if (lastUpdate == 0 - || millis() - _lastUpdateOutputCurrent > 60 * 1000) { + || millis() - lastUpdate > 60 * 1000) { return std::nullopt; }