From adcc59642c38664571daf25d05e9d41603e1a291 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sun, 5 Nov 2023 14:20:13 +0100 Subject: [PATCH] cleanup publishing --- src/emsesp.cpp | 5 +---- src/mqtt.cpp | 2 -- src/system.cpp | 3 +++ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 273027ccc..451bfe140 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -482,8 +482,6 @@ void EMSESP::publish_all(bool force) { publish_device_values(EMSdevice::DeviceType::MIXER); publish_device_values(EMSdevice::DeviceType::WATER); publish_other_values(); // switch and heat pump, ... - webSchedulerService.publish(); - webCustomEntityService.publish(); publish_sensor_values(true); // includes temperature and analog sensors system_.send_heartbeat(); } @@ -518,8 +516,6 @@ void EMSESP::publish_all_loop() { break; case 6: publish_other_values(); // switch and heat pump - webSchedulerService.publish(true); - webCustomEntityService.publish(true); break; case 7: publish_sensor_values(true, true); @@ -611,6 +607,7 @@ void EMSESP::publish_other_values() { // publish_device_values(EMSdevice::DeviceType::GATEWAY); // publish_device_values(EMSdevice::DeviceType::CONNECT); // publish_device_values(EMSdevice::DeviceType::GENERIC); + webSchedulerService.publish(); webCustomEntityService.publish(); } diff --git a/src/mqtt.cpp b/src/mqtt.cpp index d12829d8a..1b42ce084 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -179,8 +179,6 @@ void Mqtt::loop() { if (publish_time_other_ && (currentMillis - last_publish_other_ > publish_time_other_)) { last_publish_other_ = (currentMillis / publish_time_other_) * publish_time_other_; EMSESP::publish_other_values(); // switch and heatpump - EMSESP::webSchedulerService.publish(); - EMSESP::webCustomEntityService.publish(); } else if (publish_time_sensor_ && (currentMillis - last_publish_sensor_ > publish_time_sensor_)) { diff --git a/src/system.cpp b/src/system.cpp index f2b0efd9e..c6c9fe98d 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -153,6 +153,9 @@ bool System::command_publish(const char * value, const int8_t id) { } else if (value_s == (F_(mixer))) { EMSESP::publish_device_values(EMSdevice::DeviceType::MIXER); return true; + } else if (value_s == (F_(water))) { + EMSESP::publish_device_values(EMSdevice::DeviceType::WATER); + return true; } else if (value_s == "other") { EMSESP::publish_other_values(); // switch and heat pump return true;