From bc6d65c725cbcf00af7a2da3d5f3a05f262e45e5 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Sat, 9 Jul 2022 20:57:06 +1000 Subject: [PATCH] add `Speed2 !` to cancel pending one-shot speed setting --- tasmota/tasmota_xdrv_driver/xdrv_04_light.ino | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_04_light.ino b/tasmota/tasmota_xdrv_driver/xdrv_04_light.ino index dc4b027b5..94268aa99 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_04_light.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_04_light.ino @@ -3130,6 +3130,14 @@ void CmndFade(void) void CmndSpeed(void) { if (2 == XdrvMailbox.index) { + // Speed2 ! cancels use of Speed2 in the future + if ((1 == XdrvMailbox.data_len) && ('!' == XdrvMailbox.data[0])) { + Light.fade_once_enabled = false; + Light.speed_once_enabled = false; + ResponseCmndDone(); + return; + } + // Speed2 setting will be used only once, then revert to fade/speed if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 40)) { Light.fade_once_enabled = true;