Skip to content

Commit

Permalink
Fix: PowerMeter: update _lastPowerMeterUpdate for SOURCE_SML (#506)
Browse files Browse the repository at this point in the history
closes #498.
  • Loading branch information
schlimmchen authored Oct 19, 2023
1 parent b461aff commit 9172429
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/PowerMeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,17 @@ void PowerMeterClass::loop()
CONFIG_T const& config = Configuration.get();
_verboseLogging = config.PowerMeter_VerboseLogging;

if (config.PowerMeter_Enabled && config.PowerMeter_Source == SOURCE_SML) {
if (!config.PowerMeter_Enabled) { return; }

if (config.PowerMeter_Source == SOURCE_SML) {
if (!smlReadLoop()) {
return;
} else {
_lastPowerMeterUpdate = millis();
}
}

if (!config.PowerMeter_Enabled
|| (millis() - _lastPowerMeterCheck) < (config.PowerMeter_Interval * 1000)) {
if ((millis() - _lastPowerMeterCheck) < (config.PowerMeter_Interval * 1000)) {
return;
}

Expand Down

0 comments on commit 9172429

Please sign in to comment.