From c5f5bd81fe3d6a00a535fda5fd01a5c4d0994339 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Sat, 26 Oct 2019 10:31:27 +0200 Subject: [PATCH 1/2] scripter fix array bug --- sonoff/xdrv_10_scripter.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonoff/xdrv_10_scripter.ino b/sonoff/xdrv_10_scripter.ino index e4610c830..850451264 100644 --- a/sonoff/xdrv_10_scripter.ino +++ b/sonoff/xdrv_10_scripter.ino @@ -2731,7 +2731,7 @@ int16_t Run_Scripter(const char *type, int8_t tlen, char *js) { uint8_t index=glob_script_mem.type[ind.index].index; if ((vtype&STYPE)==0) { // numeric result - if (ind.bits.settable) { + if (ind.bits.settable || ind.bits.is_filter) { dfvar=&sysvar; sysv_type=ind.index; } else { From 5c45fb20b7fd078e3d86986d2a579373a46b21b2 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Sat, 26 Oct 2019 10:36:41 +0200 Subject: [PATCH 2/2] Update xdrv_10_scripter.ino --- sonoff/xdrv_10_scripter.ino | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sonoff/xdrv_10_scripter.ino b/sonoff/xdrv_10_scripter.ino index 850451264..434c1716a 100644 --- a/sonoff/xdrv_10_scripter.ino +++ b/sonoff/xdrv_10_scripter.ino @@ -2733,7 +2733,12 @@ int16_t Run_Scripter(const char *type, int8_t tlen, char *js) { // numeric result if (ind.bits.settable || ind.bits.is_filter) { dfvar=&sysvar; - sysv_type=ind.index; + if (ind.bits.settable) { + sysv_type=ind.index; + } else { + sysv_type=0; + } + } else { dfvar=&glob_script_mem.fvars[index]; sysv_type=0;