X-Git-Url: http://plrg.eecs.uci.edu/git/?p=smartapps.git;a=blobdiff_plain;f=official%2Fturn-off-with-motion.groovy;h=658dedea957ecb2ba123471b05079cbfc363d954;hp=951db43902e00ed4c4ecd3738fe606a68b23e7d0;hb=5716c253310ceee6fb0e8c9eff53ef5afbb08006;hpb=2fb86c9352aec263be71c027f89398e293974027 diff --git a/official/turn-off-with-motion.groovy b/official/turn-off-with-motion.groovy index 951db43..658dede 100755 --- a/official/turn-off-with-motion.groovy +++ b/official/turn-off-with-motion.groovy @@ -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 +}