From 94485913e572152e2542c1b80479659c15b61042 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 5 May 2021 14:59:31 +0200 Subject: [PATCH] Add teleperiod data on empty teleperiod command if set to zero Add teleperiod data on empty teleperiod command if set to zero (#12023) --- tasmota/support_command.ino | 7 ++++--- tasmota/support_tasmota.ino | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index cf25cfe76..bce9243d6 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -1857,10 +1857,11 @@ void CmndTeleperiod(void) { if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload < 3601)) { Settings.tele_period = (1 == XdrvMailbox.payload) ? TELE_PERIOD : XdrvMailbox.payload; - if ((Settings.tele_period > 0) && (Settings.tele_period < 10)) Settings.tele_period = 10; // Do not allow periods < 10 seconds -// TasmotaGlobal.tele_period = Settings.tele_period; + if ((Settings.tele_period > 0) && (Settings.tele_period < 10)) { + Settings.tele_period = 10; // Do not allow periods < 10 seconds + } } - TasmotaGlobal.tele_period = Settings.tele_period; // Show teleperiod data also on empty command + TasmotaGlobal.tele_period = (Settings.tele_period) ? Settings.tele_period : 3601; // Show teleperiod data also on empty command ResponseCmndNumber(Settings.tele_period); } diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino index df9fd2230..2d322cff8 100644 --- a/tasmota/support_tasmota.ino +++ b/tasmota/support_tasmota.ino @@ -929,7 +929,7 @@ void PerformEverySecond(void) ResetGlobalValues(); - if (Settings.tele_period) { + if (Settings.tele_period || (3601 == TasmotaGlobal.tele_period)) { if (TasmotaGlobal.tele_period >= 9999) { if (!TasmotaGlobal.global_state.network_down) { TasmotaGlobal.tele_period = 0; // Allow teleperiod once wifi is connected