mirror of https://github.com/arendst/Tasmota.git
Fix Toggle functionality to button double press when one button and two devices are detected
Fix Toggle functionality to button double press when one button and two devices are detected (#5935)
This commit is contained in:
parent
d3eaf7491d
commit
09dcb93489
|
@ -6,6 +6,7 @@
|
|||
* Add command SetOption65 0/1 and more Tuya Serial based device support (#5815)
|
||||
* Fix include of my_user_config.h in sonoff_aws_iot.cpp (#5930)
|
||||
* Fix exception 9 when syslog is enabled and NTP is just synced (#5917)
|
||||
* Fix Toggle functionality to button double press when one button and two devices are detected (#5935)
|
||||
*
|
||||
* 6.5.0.14 20190602
|
||||
* Change webserver HTML input, button, textarea, and select name based on id
|
||||
|
|
|
@ -218,11 +218,13 @@ void ButtonHandler(void)
|
|||
if ((SONOFF_DUAL_R2 == my_module_type) || (SONOFF_DUAL == my_module_type) || (CH4 == my_module_type)) {
|
||||
single_press = true;
|
||||
} else {
|
||||
if ((0 == button_index) && (1 == buttons_present)) { // Single Button1 only
|
||||
single_press = (Settings.flag.button_swap +1 == multipress[button_index]); // SetOption11 (0)
|
||||
if (Settings.flag.button_swap) { // SetOption11 (0)
|
||||
single_press = (Settings.flag.button_swap +1 == multipress[button_index]); // SetOption11 (0)
|
||||
if ((1 == buttons_present) && (2 == devices_present)) { // Single Button with two devices only
|
||||
if (Settings.flag.button_swap) { // SetOption11 (0)
|
||||
multipress[button_index] = (single_press) ? 1 : 2;
|
||||
}
|
||||
} else {
|
||||
multipress[button_index] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue