From 45bdaf14fddfcc91d822cacf2d1c2f21e5f601c7 Mon Sep 17 00:00:00 2001 From: stefanbode Date: Mon, 15 Aug 2022 21:55:57 +0200 Subject: [PATCH 1/2] stop shutter after longpress of buttons https://github.com/arendst/Tasmota/discussions/16198 improved behavior on longpress of buttons --- tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino index 153a54f38..5268470fe 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino @@ -853,6 +853,12 @@ void ShutterButtonHandler(void) } if (NOT_PRESSED == button) { + if (Shutter[shutter_index].direction && Button.hold_timer[button_index] > 0) { + XdrvMailbox.index = shutter_index +1; + XdrvMailbox.payload = XdrvMailbox.index; + AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Shtr%d, Button %d, hold %d, dir %d, index %d, payload %d"), shutter_index+1, button_index+1, Button.hold_timer[button_index],Shutter[shutter_index].direction,XdrvMailbox.index,XdrvMailbox.payload); + CmndShutterStop(); + } Button.hold_timer[button_index] = 0; } else { Button.hold_timer[button_index]++; From 69c59fc73c085415dadd22d2d2f833949c1de90e Mon Sep 17 00:00:00 2001 From: stefanbode Date: Mon, 15 Aug 2022 21:57:56 +0200 Subject: [PATCH 2/2] removed DebugLog --- tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino index 5268470fe..d92d82025 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino @@ -856,7 +856,7 @@ void ShutterButtonHandler(void) if (Shutter[shutter_index].direction && Button.hold_timer[button_index] > 0) { XdrvMailbox.index = shutter_index +1; XdrvMailbox.payload = XdrvMailbox.index; - AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Shtr%d, Button %d, hold %d, dir %d, index %d, payload %d"), shutter_index+1, button_index+1, Button.hold_timer[button_index],Shutter[shutter_index].direction,XdrvMailbox.index,XdrvMailbox.payload); + //AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Shtr%d, Button %d, hold %d, dir %d, index %d, payload %d"), shutter_index+1, button_index+1, Button.hold_timer[button_index],Shutter[shutter_index].direction,XdrvMailbox.index,XdrvMailbox.payload); CmndShutterStop(); } Button.hold_timer[button_index] = 0;