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

index a76278ec2940db7c5a64c91513d4cd1e2525cc2e..323b455b60456b657b6126fa0b812c17db772ed9 100755 (executable)
@@ -96,7 +96,7 @@ def checkRunning() {
 
                        def cycleTimeMsec = cycleTime ? cycleTime * 60000 : 600000
                        def duration = now() - state.startedAt
 
                        def cycleTimeMsec = cycleTime ? cycleTime * 60000 : 600000
                        def duration = now() - state.startedAt
-                       if (duration - fillTimeMsec > cycleTimeMsec) {
+                       if (/*duration - fillTimeMsec > cycleTimeMsec*/true) {
                                log.debug "Sending notification"
 
                                def msg = "${sensor1.displayName} is finished"
                                log.debug "Sending notification"
 
                                def msg = "${sensor1.displayName} is finished"
@@ -158,7 +158,7 @@ private flashLights() {
                def delay = 1L
                numFlashes.times {
                        log.trace "Switch on after  $delay msec"
                def delay = 1L
                numFlashes.times {
                        log.trace "Switch on after  $delay msec"
-                       switches.eachWithIndex {s, i ->
+                       switches.each {s, i ->
                                if (initialActionOn[i]) {
                                        s.on(delay: delay)
                                }
                                if (initialActionOn[i]) {
                                        s.on(delay: delay)
                                }
@@ -168,7 +168,7 @@ private flashLights() {
                        }
                        delay += onFor
                        log.trace "Switch off after $delay msec"
                        }
                        delay += onFor
                        log.trace "Switch off after $delay msec"
-                       switches.eachWithIndex {s, i ->
+                       switches.each {s, i ->
                                if (initialActionOn[i]) {
                                        s.off(delay: delay)
                                }
                                if (initialActionOn[i]) {
                                        s.off(delay: delay)
                                }