diff --git a/code/espurna/mqtt.ino b/code/espurna/mqtt.ino index ac9a7e94..bb2aa482 100644 --- a/code/espurna/mqtt.ino +++ b/code/espurna/mqtt.ino @@ -328,8 +328,6 @@ void _mqttConfigure() { if (topic.indexOf("#") == -1) topic.concat("/#"); _mqttApplySetting(_mqtt_topic, topic); - - _mqttApplyTopic(_mqtt_will, MQTT_TOPIC_STATUS); } // Getter and setter @@ -365,6 +363,11 @@ void _mqttConfigure() { _mqttApplySetting(_mqtt_clientid, id); } + // MQTT WILL + { + _mqttApplyTopic(_mqtt_will, MQTT_TOPIC_STATUS); + } + // MQTT JSON { _mqttApplySetting(_mqtt_use_json, getSetting("mqttUseJson", MQTT_USE_JSON).toInt() == 1);