mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 12:46:34 +00:00
Sync button_v2
This commit is contained in:
parent
650d72706a
commit
e3c77331c6
@ -388,8 +388,8 @@ void ButtonHandler(void) {
|
|||||||
|
|
||||||
if (NOT_PRESSED == button) {
|
if (NOT_PRESSED == button) {
|
||||||
Button.hold_timer[button_index] = 0;
|
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
|
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);
|
MqttButtonTopic(button_index +1, 6, 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Button.hold_timer[button_index]++;
|
Button.hold_timer[button_index]++;
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#define TOUCH_HIT_THRESHOLD 3 // successful hits to filter out noise
|
#define TOUCH_HIT_THRESHOLD 3 // successful hits to filter out noise
|
||||||
|
|
||||||
const char kMultiPress[] PROGMEM =
|
const char kMultiPress[] PROGMEM =
|
||||||
"|SINGLE|DOUBLE|TRIPLE|QUAD|PENTA|";
|
"|SINGLE|DOUBLE|TRIPLE|QUAD|PENTA|CLEAR|";
|
||||||
|
|
||||||
struct BUTTON {
|
struct BUTTON {
|
||||||
uint32_t debounce = 0; // Button debounce timer
|
uint32_t debounce = 0; // Button debounce timer
|
||||||
@ -256,6 +256,9 @@ void ButtonHandler(void) {
|
|||||||
|
|
||||||
if (NOT_PRESSED == button) {
|
if (NOT_PRESSED == button) {
|
||||||
Button.hold_timer[button_index] = 0;
|
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 {
|
} else {
|
||||||
Button.hold_timer[button_index]++;
|
Button.hold_timer[button_index]++;
|
||||||
if (Settings->flag.button_single) { // SetOption13 (0) - Allow only single button press for immediate action
|
if (Settings->flag.button_single) { // SetOption13 (0) - Allow only single button press for immediate action
|
||||||
|
Loading…
x
Reference in New Issue
Block a user