Fix: PowerMeter: update _lastPowerMeterUpdate for SOURCE_SML (#506)

closes #498.
This commit is contained in:
Bernhard Kirchen 2023-10-19 16:14:36 +02:00 committed by GitHub
parent b461aff622
commit 917242909b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -134,14 +134,17 @@ void PowerMeterClass::loop()
CONFIG_T const& config = Configuration.get(); CONFIG_T const& config = Configuration.get();
_verboseLogging = config.PowerMeter_VerboseLogging; _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()) { if (!smlReadLoop()) {
return; return;
} else {
_lastPowerMeterUpdate = millis();
} }
} }
if (!config.PowerMeter_Enabled if ((millis() - _lastPowerMeterCheck) < (config.PowerMeter_Interval * 1000)) {
|| (millis() - _lastPowerMeterCheck) < (config.PowerMeter_Interval * 1000)) {
return; return;
} }