From 189ea6b23dc44f5d14306f7c0c9a746c2d903b8f Mon Sep 17 00:00:00 2001 From: Proddy Date: Wed, 21 Feb 2024 23:04:32 +0100 Subject: [PATCH] Send MQTT heartbeat immediately after connection --- CHANGELOG_LATEST.md | 1 + src/mqtt.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 9ba8bb590..c77c6f712 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -41,3 +41,4 @@ - small changes to the API for analog and temperature sensors - Length of mqtt Broker adress [#1619](https://github.com/emsesp/EMS-ESP32/issues/1619) - C++ optimizations - see +- Send MQTT heartbeat immediately after connection diff --git a/src/mqtt.cpp b/src/mqtt.cpp index 3a2bdf819..2d736aa37 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -508,7 +508,7 @@ void Mqtt::on_connect() { resubscribe(); // publish to the last will topic (see Mqtt::start() function) to say we're alive - queue_publish_retain("status", "online", true); // with retain on + queue_publish_retain("status", "online", false); // with retain off // mqtt_publish_fails_ = 0; // reset fail count to 0 }