[MQTT] Fix duplicate call task PLUGIN_READ at MQTT connect

This commit is contained in:
TD-er
2021-08-11 01:29:30 +02:00
parent baae9d1fd9
commit c3e869dfeb
2 changed files with 3 additions and 12 deletions
+2 -11
View File
@@ -264,7 +264,7 @@ void scheduleNextMQTTdelayQueue() {
}
}
void schedule_all_tasks_using_MQTT_controller() {
void schedule_all_MQTTimport_tasks() {
controllerIndex_t ControllerIndex = firstEnabledMQTT_ControllerIndex();
if (!validControllerIndex(ControllerIndex)) { return; }
@@ -280,15 +280,6 @@ void schedule_all_tasks_using_MQTT_controller() {
}
}
}
for (taskIndex_t task = 0; task < TASKS_MAX; task++) {
if (Settings.TaskDeviceSendData[ControllerIndex][task] &&
Settings.ControllerEnabled[ControllerIndex] &&
Settings.Protocol[ControllerIndex])
{
Scheduler.schedule_task_device_timer_at_init(task);
}
}
}
void processMQTTdelayQueue() {
@@ -340,7 +331,7 @@ void updateMQTTclient_connected() {
MQTTclient_must_send_LWT_connected = false;
} else {
// Now schedule all tasks using the MQTT controller.
schedule_all_tasks_using_MQTT_controller();
schedule_all_MQTTimport_tasks();
}
if (Settings.UseRules) {
if (MQTTclient_connected) {
+1 -1
View File
@@ -32,7 +32,7 @@ void runEach30Seconds();
#ifdef USES_MQTT
void scheduleNextMQTTdelayQueue();
void schedule_all_tasks_using_MQTT_controller();
void schedule_all_MQTTimport_tasks();
void processMQTTdelayQueue();