From c634c3987412b13b9e3c0610550f321262a15547 Mon Sep 17 00:00:00 2001 From: MichaelDvP <59284019+MichaelDvP@users.noreply.github.com> Date: Wed, 30 Jun 2021 14:26:46 +0200 Subject: [PATCH] 3. fix for mqtt enable (#79) --- src/mqtt.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/mqtt.cpp b/src/mqtt.cpp index 49800ab16..36a16cf49 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -655,12 +655,9 @@ void Mqtt::on_connect() { EMSESP::shower_.send_mqtt_stat(false); // Send shower_activated as false EMSESP::system_.send_heartbeat(); // send heatbeat - if (connectcount_ > 1) { - // we doing a re-connect from a TCP break - // only re-subscribe again to all MQTT topics - resubscribe(); - EMSESP::reset_mqtt_ha(); // re-create all HA devices if there are any - } + // re-subscribe to all MQTT topics + resubscribe(); + EMSESP::reset_mqtt_ha(); // re-create all HA devices if there are any publish_retain(F("status"), "online", true); // say we're alive to the Last Will topic, with retain on