Browse Source

Merge branch 'main' of https://github.com/grindylow/ahoy

pull/109/head
Andreas Schiffler 3 years ago
parent
commit
84cd0c419b
  1. 2
      tools/esp8266/app.cpp
  2. 6
      tools/esp8266/mqtt.h

2
tools/esp8266/app.cpp

@ -954,7 +954,7 @@ void app::sendMqttDiscoveryConfig(void) {
}
serializeJson(doc, buffer);
mMqtt.sendMsg2(discoveryTopic, buffer);
mMqtt.sendMsg2(discoveryTopic, buffer, true);
doc.clear();
yield();

6
tools/esp8266/mqtt.h

@ -39,15 +39,15 @@ class mqtt {
//DPRINTLN(DBG_VERBOSE, F("mqtt.h:sendMsg"));
char top[64];
snprintf(top, 64, "%s/%s", mTopic, topic);
sendMsg2(top, msg);
sendMsg2(top, msg, false);
}
void sendMsg2(const char *topic, const char *msg) {
void sendMsg2(const char *topic, const char *msg, boolean retained) {
if(mAddressSet) {
if(!mClient->connected())
reconnect();
if(mClient->connected())
mClient->publish(topic, msg);
mClient->publish(topic, msg, retained);
}
}

Loading…
Cancel
Save