def onHandler(evt) {
log.debug evt.value
- log.debug onSwitches()
- onSwitches()?.on()
+ log.debug onSwitches1()
+ onSwitches1()*.on()
}
def offHandler(evt) {
log.debug evt.value
- log.debug offSwitches()
- offSwitches()?.off()
+ log.debug offSwitches1()
+ offSwitches1()*.off()
}
def dimHandler(evt) {
dimSwitches?.setLevel(evt.value)
}
-private onSwitches() {
- if(switches && onSwitches) { switches + onSwitches }
- else if(switches) { switches }
- else { onSwitches }
+private onSwitches1() {
+ if(switches && onSwitches) { (switches).findAll{it} + (onSwitches).findAll{it} }
+ else if(switches) { (switches).findAll{it} }
+ else { (onSwitches).findAll{it} }
}
-private offSwitches() {
- if(switches && offSwitches) { switches + offSwitches }
- else if(switches) { switches }
- else { offSwitches }
+private offSwitches1() {
+ if(switches && offSwitches) { (switches).findAll{it} + (offSwitches).findAll{it} }
+ else if(switches) { (switches).findAll{it} }
+ else { (offSwitches).findAll{it} }
}