Update laundry-monitor.groovy
authorSeyed Amir Hossein Aqajari <amiraj.95@uci.edu>
Sat, 10 Aug 2019 20:26:44 +0000 (13:26 -0700)
committerGitHub Enterprise <noreply@github.uci.edu>
Sat, 10 Aug 2019 20:26:44 +0000 (13:26 -0700)
official/laundry-monitor.groovy

index c71cbd5aecc2d821d88e1c921c8bc19053ed08c6..9adabba8416941a27f27bc7b1d16b11995a767fb 100755 (executable)
@@ -158,7 +158,7 @@ private flashLights() {
                def delay = 1L
                numFlashes.times {
                        log.trace "Switch on after  $delay msec"
-                       switches.each {s, i ->
+                       switches.eachWithIndex {s, i ->
                                if (initialActionOn[i]) {
                                        s.on(delay: delay)
                                }
@@ -168,7 +168,7 @@ private flashLights() {
                        }
                        delay += onFor
                        log.trace "Switch off after $delay msec"
-                       switches.each {s, i ->
+                       switches.eachWithIndex {s, i ->
                                if (initialActionOn[i]) {
                                        s.off(delay: delay)
                                }