Skip to content

Commit 2416f4e

Browse files
committed
fix mqtt logic if no MQTT_HOST is defined, leads to endless sleep otherwise
1 parent 1270318 commit 2416f4e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/mqtt.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,13 @@ void startMQTTStatusTask()
558558
mqttRun = false;
559559
mqttKill = false;
560560

561+
#ifndef MQTT_HOST
562+
// if no MQTT, return early
563+
Serial.println("[MQTT] not starting status task, MQTT_HOST not defined");
564+
mqttFailed = true; // to avoid endless wait in sleep.cpp#86
565+
return;
566+
#endif
567+
561568
xTaskCreate(
562569
sendMQTTStatusTask, /* Task function. */
563570
"MQTT_STAT_TASK", /* String with name of task. */

0 commit comments

Comments
 (0)