From a0e265c119a001e632150237fc406d4e6ce81e14 Mon Sep 17 00:00:00 2001 From: proddy Date: Mon, 16 Dec 2019 17:03:21 +0100 Subject: [PATCH] fixes to publish_time --- src/ems-esp.cpp | 9 +++++---- src/version.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ems-esp.cpp b/src/ems-esp.cpp index d9b29c308..a80890c53 100644 --- a/src/ems-esp.cpp +++ b/src/ems-esp.cpp @@ -545,7 +545,6 @@ void publishEMSValues(bool force) { char s[20] = {0}; // for formatting strings StaticJsonDocument doc; char data[MQTT_MAX_PAYLOAD_SIZE] = {0}; - uint8_t jsonSize; static uint8_t last_boilerActive = 0xFF; // for remembering last setting of the tap water or heating on/off @@ -1924,12 +1923,14 @@ void loop() { ds18.loop(); } - // publish EMS data to MQTT - // because of the force=false argument, it will see if there is anything received that must be published - publishEMSValues(false); + // publish EMS data to MQTT, only if in automatic mode (publish_time=0) otherwise it'll use the timer + if (EMSESP_Settings.publish_time == 0) { + publishEMSValues(false); + } // if we have an EMS connect go and fetch some data and MQTT publish it if (_need_first_publish) { + publishEMSValues(false); publishSensorValues(); _need_first_publish = false; // reset flag } diff --git a/src/version.h b/src/version.h index 8ce1c1208..abc657ea0 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define APP_VERSION "1.9.5b1" +#define APP_VERSION "1.9.5b2"