Skip to content

Commit

Permalink
fix data age validation
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasBoehm committed Jan 15, 2025
1 parent 52e3ea6 commit b169cae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/solarcharger/mqtt/Stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void Stats::setOutputCurrent(const float current) {
std::optional<float> 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;
}

Expand Down

0 comments on commit b169cae

Please sign in to comment.