From a39626bb0e335b1b07d2a3598929bcc77c9f30d5 Mon Sep 17 00:00:00 2001 From: proddy Date: Fri, 15 May 2026 13:05:43 +0200 Subject: [PATCH] add comments --- src/core/emsesp.cpp | 4 ++-- src/core/mqtt.cpp | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/emsesp.cpp b/src/core/emsesp.cpp index 8411e962c..60053bfa3 100644 --- a/src/core/emsesp.cpp +++ b/src/core/emsesp.cpp @@ -587,7 +587,7 @@ void EMSESP::publish_all(bool force) { publish_other_values(); // switch and heat pump, ... publish_sensor_values(true); // includes temperature and analog sensors - system_.send_heartbeat(); + system_.send_heartbeat(); // send MQTT heartbeat topic } } @@ -628,7 +628,7 @@ void EMSESP::publish_all_loop() { if (Mqtt::ha_enabled()) { Mqtt::ha_status(); } - system_.send_heartbeat(); + system_.send_heartbeat(); // send MQTT heartbeat topic break; default: // all finished diff --git a/src/core/mqtt.cpp b/src/core/mqtt.cpp index bb501cafb..9d4eede7c 100644 --- a/src/core/mqtt.cpp +++ b/src/core/mqtt.cpp @@ -131,10 +131,10 @@ void Mqtt::loop() { uint32_t currentMillis = uuid::get_uptime(); - // send heartbeat + // send heartbeat per the frequency in the MQTT settings if (currentMillis - last_publish_heartbeat_ > publish_time_heartbeat_) { last_publish_heartbeat_ = currentMillis; - EMSESP::system_.send_heartbeat(); // send heartbeat + EMSESP::system_.send_heartbeat(); // send MQTT heartbeat topic } // temperature and analog sensor publish on change @@ -511,7 +511,6 @@ void Mqtt::on_connect() { // send initial MQTT messages for some of our services EMSESP::system_.send_heartbeat(); // send heartbeat - // for publish on change publish the initial complete list EMSESP::webCustomEntityService.publish(true); EMSESP::webSchedulerService.publish(true); EMSESP::analogsensor_.publish_values(true);