From f6ed6edd75abb9689352dccb7399a05c2e862863 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Wed, 16 Oct 2019 05:33:22 +0200 Subject: [PATCH] scripter better button event --- sonoff/xdrv_10_scripter.ino | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sonoff/xdrv_10_scripter.ino b/sonoff/xdrv_10_scripter.ino index ef4175566..ee78cc740 100644 --- a/sonoff/xdrv_10_scripter.ino +++ b/sonoff/xdrv_10_scripter.ino @@ -1073,6 +1073,7 @@ chknext: uint32_t index=fvar; if (index<1 || index>MAX_KEYS) index=1; fvar=script_button[index-1]; + script_button[index-1]|=0x80; len++; goto exit; } @@ -4794,7 +4795,7 @@ bool Xdrv10(uint8_t function) #ifdef USE_BUTTON_EVENT case FUNC_BUTTON_PRESSED: if (bitRead(Settings.rule_enabled, 0)) { - if (script_button[XdrvMailbox.index]!=XdrvMailbox.payload) { + if ((script_button[XdrvMailbox.index]&1)!=(XdrvMailbox.payload&1)) { script_button[XdrvMailbox.index]=XdrvMailbox.payload; Run_Scripter(">b",2,0); }