simplify main for vedirect

This commit is contained in:
helgeerbe 2023-02-13 11:41:51 +01:00
parent f89ccdd2ee
commit 17e564a094
2 changed files with 10 additions and 10 deletions

View File

@ -16,6 +16,9 @@ void MqttHandleVedirectHassClass::init()
void MqttHandleVedirectHassClass::loop() void MqttHandleVedirectHassClass::loop()
{ {
if (!Configuration.get().Vedirect_Enabled) {
return;
}
if (_updateForced) { if (_updateForced) {
publishConfig(); publishConfig();
_updateForced = false; _updateForced = false;

View File

@ -182,24 +182,21 @@ void loop()
yield(); yield();
Hoymiles.loop(); Hoymiles.loop();
yield(); yield();
// Vedirect_Enabled is unknown to lib. Therefor check has to be done here
if (Configuration.get().Vedirect_Enabled) { if (Configuration.get().Vedirect_Enabled) {
VeDirect.loop(); VeDirect.loop();
yield(); yield();
} }
MqttHandleDtu.loop(); MqttHandleDtu.loop();
yield(); yield();
MqttHandleInverter.loop(); MqttHandleInverter.loop();
yield(); yield();
if (Configuration.get().Vedirect_Enabled) { MqttHandleVedirect.loop();
MqttHandleVedirect.loop(); yield();
yield();
}
MqttHandleHass.loop(); MqttHandleHass.loop();
yield(); yield();
if (Configuration.get().Vedirect_Enabled) { MqttHandleVedirectHass.loop();
MqttHandleVedirectHass.loop(); yield();
yield();
}
WebApi.loop(); WebApi.loop();
yield(); yield();
Display.loop(); Display.loop();