From e6556557cf5497a28593ae413db0b5f35a00aa06 Mon Sep 17 00:00:00 2001 From: proddy Date: Fri, 29 Nov 2019 20:37:19 +0100 Subject: [PATCH] fix publish_time to always send when it has a 0 value --- platformio.ini | 6 +++--- src/ems-esp.cpp | 12 +++++++----- src/version.h | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/platformio.ini b/platformio.ini index 2468d31c9..da681e846 100644 --- a/platformio.ini +++ b/platformio.ini @@ -59,9 +59,9 @@ monitor_speed = 115200 ;upload_port = /dev/cu.wchusbserial14403 ;upload_port = /dev/cu.usbserial-1440 -; uncomment these next 2 lines if using OTA instead of going direct via USB -;upload_protocol = espota -;upload_port = ems-esp.local +; comment out this section if using USB and not OTA for firmware uploads +upload_protocol = espota +upload_port = ems-esp.local # # These following targets are used by TravisCI to build the firmware versions on Release diff --git a/src/ems-esp.cpp b/src/ems-esp.cpp index 50a61b1ac..69cd55363 100644 --- a/src/ems-esp.cpp +++ b/src/ems-esp.cpp @@ -572,10 +572,8 @@ void publishEMSValues(bool force) { return; // EMS bus is not connected } - // override force id not on automatic mode. Always send values is there is a publish_time set - if (EMSESP_Settings.publish_time != 0) { - force = true; - } + // Always send values is there is a publish_time is set to 0 + force = !EMSESP_Settings.publish_time; char s[20] = {0}; // for formatting strings StaticJsonDocument doc; @@ -1186,7 +1184,11 @@ bool SetListCallback(MYESP_FSACTION_t action, uint8_t wc, const char * setting, myDebug_P(PSTR(" listen_mode=%s"), EMSESP_Settings.listen_mode ? "on" : "off"); myDebug_P(PSTR(" shower_timer=%s"), EMSESP_Settings.shower_timer ? "on" : "off"); myDebug_P(PSTR(" shower_alert=%s"), EMSESP_Settings.shower_alert ? "on" : "off"); - myDebug_P(PSTR(" publish_time=%d"), EMSESP_Settings.publish_time); + if (EMSESP_Settings.publish_time) { + myDebug_P(PSTR(" publish_time=%d"), EMSESP_Settings.publish_time); + } else { + myDebug_P(PSTR(" publish_time=0 (always publish when data received)"), EMSESP_Settings.publish_time); + } } return ok; diff --git a/src/version.h b/src/version.h index 82ceb481e..15759c73e 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define APP_VERSION "1.9.4b19" +#define APP_VERSION "1.9.4b20"