Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/src/Globals/Plugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1013,9 +1013,10 @@ bool PluginCall(uint8_t Function, struct EventStruct *event, String& str)
case PLUGIN_GET_UOM_GROUPS:
#endif // if FEATURE_TASKVALUE_UNIT_OF_MEASURE

// PLUGIN_MQTT_xxx functions are directly called from the scheduler.
// case PLUGIN_MQTT_CONNECTION_STATE:
// case PLUGIN_MQTT_IMPORT:
#if FEATURE_MQTT
case PLUGIN_MQTT_CONNECTION_STATE:
case PLUGIN_MQTT_IMPORT:
#endif // if FEATURE_MQTT
{
START_TIMER;
const deviceIndex_t DeviceIndex = getDeviceIndex_from_TaskIndex(event->TaskIndex);
Expand Down
9 changes: 2 additions & 7 deletions src/src/Helpers/PeriodicalActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,6 @@ void scheduleNextMQTTdelayQueue() {
}

void schedule_all_MQTTimport_tasks() {
controllerIndex_t ControllerIndex = firstEnabledMQTT_ControllerIndex();

if (!validControllerIndex(ControllerIndex)) { return; }

constexpr pluginID_t PLUGIN_MQTT_IMPORT(PLUGIN_ID_MQTT_IMPORT);

deviceIndex_t DeviceIndex = getDeviceIndex(PLUGIN_MQTT_IMPORT); // Check if P037_MQTTimport is present in the build
Expand Down Expand Up @@ -420,9 +416,6 @@ void updateMQTTclient_connected() {
addLogMove(LOG_LEVEL_ERROR, connectionError);
}
MQTTclient_must_send_LWT_connected = false;
} else {
// Now schedule all tasks using the MQTT controller.
schedule_all_MQTTimport_tasks();
}
if (Settings.UseRules) {
if (MQTTclient_connected) {
Expand All @@ -431,6 +424,8 @@ void updateMQTTclient_connected() {
eventQueue.add(F("MQTT#Disconnected"));
}
}
// Now schedule all tasks using the MQTT Import plugin.
schedule_all_MQTTimport_tasks();
}
if (!MQTTclient_connected) {
// As suggested here: https://github.com/letscontrolit/ESPEasy/issues/1356
Expand Down