mqtt heartbeat, no need to check if connected

This commit is contained in:
proddy
2025-11-30 10:22:08 +01:00
parent 8ca9f7ee30
commit 76c827257e
2 changed files with 3 additions and 8 deletions

View File

@@ -509,14 +509,14 @@ void Mqtt::on_connect() {
queue_subscribe_message(discovery_prefix_ + "/+/" + Mqtt::basename() + "/#");
}
// send initial MQTT messages for some of our services
EMSESP::system_.send_heartbeat(); // send heartbeat
// re-subscribe to all custom registered MQTT topics
resubscribe();
// publish to the last will topic (see Mqtt::start() function) to say we're alive
queue_publish_retain("status", "online"); // retain: https://github.com/emsesp/EMS-ESP32/discussions/2086
// send initial MQTT messages for some of our services
EMSESP::system_.send_heartbeat(); // send heartbeat
}
// Home Assistant Discovery - the main master Device called EMS-ESP