mirror of
https://github.com/wled/WLED.git
synced 2025-07-24 19:26:40 +00:00
Revert status message change
This commit is contained in:
parent
07e303bcc1
commit
ecc3eae247
@ -55,8 +55,8 @@ static void onMqttConnect(bool sessionPresent)
|
|||||||
DEBUG_PRINTLN(F("MQTT ready"));
|
DEBUG_PRINTLN(F("MQTT ready"));
|
||||||
|
|
||||||
#ifndef USERMOD_SMARTNEST
|
#ifndef USERMOD_SMARTNEST
|
||||||
snprintf_P(mqttStatusTopic, sizeof(mqttStatusTopic)-1, sTopicFormat, MQTT_MAX_TOPIC_LEN, mqttDeviceTopic, "status");
|
snprintf_P(subuf, sizeof(subuf)-1, sTopicFormat, MQTT_MAX_TOPIC_LEN, mqttDeviceTopic, "status");
|
||||||
mqtt->setWill(mqttStatusTopic, 0, true, "offline"); // LWT message
|
mqtt->publish(subuf, 0, true, "online"); // retain message for a LWT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
publishMqtt();
|
publishMqtt();
|
||||||
@ -231,6 +231,10 @@ bool initMqtt()
|
|||||||
mqtt->setClientId(mqttClientID);
|
mqtt->setClientId(mqttClientID);
|
||||||
if (mqttUser[0] && mqttPass[0]) mqtt->setCredentials(mqttUser, mqttPass);
|
if (mqttUser[0] && mqttPass[0]) mqtt->setCredentials(mqttUser, mqttPass);
|
||||||
|
|
||||||
|
#ifndef USERMOD_SMARTNEST
|
||||||
|
snprintf_P(mqttStatusTopic, sizeof(mqttStatusTopic)-1, sTopicFormat, MQTT_MAX_TOPIC_LEN, mqttDeviceTopic, "status");
|
||||||
|
mqtt->setWill(mqttStatusTopic, 0, true, "offline"); // LWT message
|
||||||
|
#endif
|
||||||
mqtt->setKeepAlive(MQTT_KEEP_ALIVE_TIME);
|
mqtt->setKeepAlive(MQTT_KEEP_ALIVE_TIME);
|
||||||
mqtt->connect();
|
mqtt->connect();
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user