From c196fa25428e22df36b796b19265539d6856f030 Mon Sep 17 00:00:00 2001 From: Tomas Bara Date: Mon, 20 Jan 2020 13:44:11 +0100 Subject: [PATCH] Set MQTT will topic after /get suffix initialization #2106 (#2115) --- code/espurna/mqtt.ino | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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);