Skip to content

Commit

Permalink
Merge pull request #58 from elratt0r/fix_mqtt_logic
Browse files Browse the repository at this point in the history
fix mqtt logic if no MQTT_HOST is defined
  • Loading branch information
lanrat authored Oct 21, 2024
2 parents 1270318 + 2416f4e commit 3dc7206
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/mqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,13 @@ void startMQTTStatusTask()
mqttRun = false;
mqttKill = false;

#ifndef MQTT_HOST
// if no MQTT, return early
Serial.println("[MQTT] not starting status task, MQTT_HOST not defined");
mqttFailed = true; // to avoid endless wait in sleep.cpp#86
return;
#endif

xTaskCreate(
sendMQTTStatusTask, /* Task function. */
"MQTT_STAT_TASK", /* String with name of task. */
Expand Down

0 comments on commit 3dc7206

Please sign in to comment.