diff --git a/CHANGELOG.md b/CHANGELOG.md index b703c7412..589a19636 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. ## [13.0.0.1] ### Added +- Command ``Delay -1`` to wait until next second (#18984) ### Breaking Changed - Berry `bool( [] )` and `bool( {} )` now evaluate as `false` (#18986) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index de625b717..e3395e77e 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -112,6 +112,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm ## Changelog v13.0.0.1 ### Added +- Command ``Delay -1`` to wait until next second [#18984](https://github.com/arendst/Tasmota/issues/18984) ### Breaking Changed - Berry `bool( [] )` and `bool( {} )` now evaluate as `false` [#18986](https://github.com/arendst/Tasmota/issues/18986) diff --git a/tasmota/tasmota_support/support_command.ino b/tasmota/tasmota_support/support_command.ino index ca205150d..c775b8aab 100644 --- a/tasmota/tasmota_support/support_command.ino +++ b/tasmota/tasmota_support/support_command.ino @@ -651,9 +651,15 @@ void CmndJson(void) { } } -void CmndDelay(void) -{ - if ((XdrvMailbox.payload >= (MIN_BACKLOG_DELAY / 100)) && (XdrvMailbox.payload <= 3600)) { +void CmndDelay(void) { + // Delay -1 - Wait until next second + // Delay 1 - Wait default time (200ms) + // Delay 2 - Wait 2 x 100ms + // Delay 10 - Wait 10 x 100ms + if (XdrvMailbox.payload == -1) { + TasmotaGlobal.backlog_timer = millis() + (1000 - RtcMillis()); // Next second (#18984) + } + else if ((XdrvMailbox.payload >= (MIN_BACKLOG_DELAY / 100)) && (XdrvMailbox.payload <= 3600)) { TasmotaGlobal.backlog_timer = millis() + (100 * XdrvMailbox.payload); } uint32_t bl_delay = 0;