Improved MQTT stability and changed some defaults

This commit is contained in:
Gunnar Skjold
2024-04-09 17:16:12 +02:00
parent a7d3382947
commit 89015191de
8 changed files with 75 additions and 9 deletions

View File

@@ -29,22 +29,25 @@ bool HomeAssistantMqttHandler::publish(AmsData* data, AmsData* previousState, En
if(data->getListType() >= 3) { // publish energy counts
publishList3(data, ea);
loop();
mqtt.loop();
}
if(data->getListType() == 1) { // publish power counts
publishList1(data, ea);
mqtt.loop();
} else if(data->getListType() <= 3) { // publish power counts and volts/amps
publishList2(data, ea);
mqtt.loop();
} else if(data->getListType() == 4) { // publish power counts and volts/amps/phase power and PF
publishList4(data, ea);
mqtt.loop();
}
loop();
if(ea->isInitialized()) {
publishRealtime(data, ea, ps);
loop();
mqtt.loop();
}
loop();
return true;
}