3. fix for mqtt enable (#79)

This commit is contained in:
MichaelDvP
2021-06-30 14:26:46 +02:00
committed by GitHub
parent ae0846e877
commit c634c39874

View File

@@ -655,12 +655,9 @@ void Mqtt::on_connect() {
EMSESP::shower_.send_mqtt_stat(false); // Send shower_activated as false EMSESP::shower_.send_mqtt_stat(false); // Send shower_activated as false
EMSESP::system_.send_heartbeat(); // send heatbeat EMSESP::system_.send_heartbeat(); // send heatbeat
if (connectcount_ > 1) { // re-subscribe to all MQTT topics
// we doing a re-connect from a TCP break
// only re-subscribe again to all MQTT topics
resubscribe(); resubscribe();
EMSESP::reset_mqtt_ha(); // re-create all HA devices if there are any 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 publish_retain(F("status"), "online", true); // say we're alive to the Last Will topic, with retain on