From 861332ccacedd0be2be9633ebf80a9d794cbd48b Mon Sep 17 00:00:00 2001 From: Seyed Amir Hossein Aqajari Date: Thu, 8 Aug 2019 11:47:03 -0700 Subject: [PATCH] Update the-big-switch.groovy --- official/the-big-switch.groovy | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/official/the-big-switch.groovy b/official/the-big-switch.groovy index 4dd1359..e566e66 100755 --- a/official/the-big-switch.groovy +++ b/official/the-big-switch.groovy @@ -66,13 +66,13 @@ def logHandler(evt) { def onHandler(evt) { log.debug evt.value log.debug onSwitches1() - onSwitches1()?.on() + onSwitches1()*.on() } def offHandler(evt) { log.debug evt.value log.debug offSwitches1() - offSwitches1()?.off() + offSwitches1()*.off() } def dimHandler(evt) { @@ -81,13 +81,13 @@ def dimHandler(evt) { } private onSwitches1() { - if(switches && onSwitches) { switches + onSwitches } - else if(switches) { switches } - else { onSwitches } + if(switches && onSwitches) { (switches).findAll{it} + (onSwitches).findAll{it} } + else if(switches) { (switches).findAll{it} } + else { (onSwitches).findAll{it} } } private offSwitches1() { - if(switches && offSwitches) { switches + offSwitches } - else if(switches) { switches } - else { offSwitches } + if(switches && offSwitches) { (switches).findAll{it} + (offSwitches).findAll{it} } + else if(switches) { (switches).findAll{it} } + else { (offSwitches).findAll{it} } } -- 2.34.1