PowerMeter: Whitespace and {} fixes

This commit is contained in:
berni2288 2023-04-07 20:22:35 +02:00
parent 00def1d8d1
commit 19b2dd4c7a
No known key found for this signature in database
GPG Key ID: 713D4DB28836DC41

View File

@ -58,7 +58,7 @@ void PowerMeterClass::init()
HttpPowerMeter.init();
}
if(config.PowerMeter_Source == SOURCE_SML) {
if (config.PowerMeter_Source == SOURCE_SML) {
pinMode(SML_RX_PIN, INPUT);
inputSerial.begin(9600, SWSERIAL_8N1, SML_RX_PIN, -1, false, 128, 95);
inputSerial.enableRx(true);
@ -184,14 +184,16 @@ bool PowerMeterClass::smlReadLoop()
unsigned char smlCurrentChar = inputSerial.read();
sml_states_t smlCurrentState = smlState(smlCurrentChar);
if (smlCurrentState == SML_LISTEND) {
for(auto& handler: smlHandlerList) {
for (auto& handler: smlHandlerList) {
if (smlOBISCheck(handler.OBIS)) {
handler.Fn(readVal);
*handler.Arg = readVal;
}
}
} else if (smlCurrentState == SML_FINAL)
} else if (smlCurrentState == SML_FINAL) {
return true;
}
}
return false;
}