From 1e0e6cd1c83f58e028c56520968e4c94db35aeb2 Mon Sep 17 00:00:00 2001 From: Miguel Cabral Date: Sun, 25 Sep 2022 19:43:32 +0100 Subject: [PATCH] Publish CLEAR message on button HOLD release when SO73 is ON --- tasmota/tasmota_support/support_button _v3.ino | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasmota/tasmota_support/support_button _v3.ino b/tasmota/tasmota_support/support_button _v3.ino index 1fe449b77..a7d776261 100644 --- a/tasmota/tasmota_support/support_button _v3.ino +++ b/tasmota/tasmota_support/support_button _v3.ino @@ -35,7 +35,7 @@ const uint8_t BUTTON_FAST_PROBE_INTERVAL = 2; // Time in milliseconds between b const uint8_t BUTTON_AC_PERIOD = (20 + BUTTON_FAST_PROBE_INTERVAL - 1) / BUTTON_FAST_PROBE_INTERVAL; // Duration of an AC wave in probe intervals const char kMultiPress[] PROGMEM = - "|SINGLE|DOUBLE|TRIPLE|QUAD|PENTA|"; + "|SINGLE|DOUBLE|TRIPLE|QUAD|PENTA|CLEAR|"; #include @@ -388,6 +388,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