From 2c29c0b533dcb73709d244461cb720776370d1a1 Mon Sep 17 00:00:00 2001 From: stefanbode Date: Sat, 5 Aug 2023 13:20:54 +0200 Subject: [PATCH 1/2] skip stop on hold if grouptopic If shutterbutton is defined with a grouptopic send on HOLD, there is no stop on releasing the button. All shutters will move to defined position --- tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino index e49c1b633ae9..c5255c5637fd 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino @@ -947,7 +947,11 @@ bool ShutterButtonHandler(void) if (NOT_PRESSED == button) { //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); - if (Shutter[shutter_index].direction && (Button.hold_timer[button_index] > 0 && (!Settings->flag.button_single || Button.hold_timer[button_index] > 20))) { + if (Shutter[shutter_index].direction + && (Button.hold_timer[button_index] > 0 + && (!Settings->flag.button_single + || Button.hold_timer[button_index] > 20)) + && !(Settings->shutter_button[button_index] & (0x01<<29))) { 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); From 5a181083a8663dc013df432b6153078b71c69404 Mon Sep 17 00:00:00 2001 From: stefanbode Date: Sat, 5 Aug 2023 13:31:28 +0200 Subject: [PATCH 2/2] do not stop on hold release if group submitt If mqtt broadcast is defined on hold then release the hold button will not anymore stop the local shutter. All shutter will move to defined position --- tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino index 9ff0807c0e68..538e11fe492f 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino @@ -1265,7 +1265,8 @@ bool ShutterButtonHandler(void) // handle on button release: start shutter on shortpress and stop running shutter after longpress. if (NOT_PRESSED == button && Shutter[shutter_index].direction != 0 // only act on shutters activly moving - && Button.hold_timer[button_index] > 0) // kick in on first release of botton. do not check for multipress + && Button.hold_timer[button_index] > 0 // kick in on first release of botton. do not check for multipress + && !ShutterSettings.shutter_button[button_index].position[3].mqtt_broadcast ) // do not stop on hold release if broadcast { XdrvMailbox.index = shutter_index +1; XdrvMailbox.payload = -99; // reset any payload to invalid