Update turn-off-with-motion.groovy
authorSeyed Amir Hossein Aqajari <amiraj.95@uci.edu>
Sat, 10 Aug 2019 22:59:54 +0000 (15:59 -0700)
committerGitHub Enterprise <noreply@github.uci.edu>
Sat, 10 Aug 2019 22:59:54 +0000 (15:59 -0700)
official/turn-off-with-motion.groovy

index 951db43..658dede 100755 (executable)
@@ -68,15 +68,15 @@ def motionHandler(evt) {
 def scheduleCheck() {
        log.debug "schedule check, ts = ${state.inactiveAt}"
        if (state.inactiveAt) {
-               def elapsed = now() - state.inactiveAt
-               def threshold = 1000 * 60 * minutes1
-               if (elapsed >= threshold) {
+               //def elapsed = now() - state.inactiveAt
+               //def threshold = 1000 * 60 * minutes1
+               if (/*elapsed >= threshold*/true) {
                        log.debug "turning off lights"
                        switches.on()
                        state.inactiveAt = null
                }
                else {
-                       log.debug "${elapsed / 1000} sec since motion stopped"
+                       log.debug "since motion stopped"
                }
        }
-}
\ No newline at end of file
+}