From e3c77331c6479fe8e84cee2ece0a8dd1ad961c2d Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 26 Sep 2022 10:37:43 +0200 Subject: [PATCH] Sync button_v2 --- tasmota/tasmota_support/support_button _v3.ino | 4 ++-- tasmota/tasmota_support/support_button_v2.ino | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tasmota/tasmota_support/support_button _v3.ino b/tasmota/tasmota_support/support_button _v3.ino index a7d776261..617235e81 100644 --- a/tasmota/tasmota_support/support_button _v3.ino +++ b/tasmota/tasmota_support/support_button _v3.ino @@ -388,8 +388,8 @@ void ButtonHandler(void) { if (NOT_PRESSED == button) { Button.hold_timer[button_index] = 0; - if (Settings->flag3.mqtt_buttons && PRESSED == Button.last_state[button_index] && !Button.press_counter[button_index]) { // SetOption73 (0) - Decouple button from relay and send just mqtt topic - MqttButtonTopic(button_index + 1, 6, 0); + if (Settings->flag3.mqtt_buttons && (PRESSED == Button.last_state[button_index]) && !Button.press_counter[button_index]) { // SetOption73 (0) - Decouple button from relay and send just mqtt topic + MqttButtonTopic(button_index +1, 6, 0); } } else { Button.hold_timer[button_index]++; diff --git a/tasmota/tasmota_support/support_button_v2.ino b/tasmota/tasmota_support/support_button_v2.ino index 19538b0ed..7dca673ed 100644 --- a/tasmota/tasmota_support/support_button_v2.ino +++ b/tasmota/tasmota_support/support_button_v2.ino @@ -29,7 +29,7 @@ #define TOUCH_HIT_THRESHOLD 3 // successful hits to filter out noise const char kMultiPress[] PROGMEM = - "|SINGLE|DOUBLE|TRIPLE|QUAD|PENTA|"; + "|SINGLE|DOUBLE|TRIPLE|QUAD|PENTA|CLEAR|"; struct BUTTON { uint32_t debounce = 0; // Button debounce timer @@ -256,6 +256,9 @@ void ButtonHandler(void) { if (NOT_PRESSED == button) { Button.hold_timer[button_index] = 0; + if (Settings->flag3.mqtt_buttons && (PRESSED == Button.last_state[button_index]) && !Button.press_counter[button_index]) { // SetOption73 (0) - Decouple button from relay and send just mqtt topic + MqttButtonTopic(button_index +1, 6, 0); + } } else { Button.hold_timer[button_index]++; if (Settings->flag.button_single) { // SetOption13 (0) - Allow only single button press for immediate action