Update laundry-monitor.groovy
[smartapps.git] / official / laundry-monitor.groovy
index a76278ec2940db7c5a64c91513d4cd1e2525cc2e..c71cbd5aecc2d821d88e1c921c8bc19053ed08c6 100755 (executable)
@@ -96,7 +96,7 @@ def checkRunning() {
 
                        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"
@@ -138,9 +138,9 @@ def checkRunning() {
 
 private flashLights() {
        def doFlash = true
-       def onFor = onFor ?: 1000
-       def offFor = offFor ?: 1000
-       def numFlashes = numFlashes ?: 3
+       def onFor = 1000
+       def offFor = 1000
+       def numFlashes = 3
 
        log.debug "LAST ACTIVATED IS: ${state.lastActivated}"
        if (state.lastActivated) {
@@ -158,7 +158,7 @@ private flashLights() {
                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)
                                }
@@ -168,7 +168,7 @@ private flashLights() {
                        }
                        delay += onFor
                        log.trace "Switch off after $delay msec"
-                       switches.eachWithIndex {s, i ->
+                       switches.each {s, i ->
                                if (initialActionOn[i]) {
                                        s.off(delay: delay)
                                }