X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=official%2Flight-follows-me.groovy;h=83a295cf29cba25bf53f3d9d50b6fb953606dba3;hb=d1f1914abc5a1a233ed79fb4115fc989f0156971;hp=06f4fc1c866f93c99b72c0e6e8b81680cd445fca;hpb=bff0c5aa39be2900fe7420929a2ad6bea02a2281;p=smartapps.git diff --git a/official/light-follows-me.groovy b/official/light-follows-me.groovy index 06f4fc1..83a295c 100755 --- a/official/light-follows-me.groovy +++ b/official/light-follows-me.groovy @@ -59,14 +59,14 @@ def motionHandler(evt) { def scheduleCheck() { log.debug "schedule check" def motionState = motion1.currentState("motion") - if (motionState.value == "inactive") { + if (motionState == "inactive") { //def elapsed = now() - motionState.rawDateCreated.time //def threshold = 1000 * 60 * minutes1 - 1000 if (/*elapsed >= threshold*/true) { - log.debug "Motion has stayed inactive long enough since last check ($elapsed ms): turning lights off" + log.debug "Motion has stayed inactive long enough since last check: turning lights off" switches.off() } else { - log.debug "Motion has not stayed inactive long enough since last check ($elapsed ms): doing nothing" + log.debug "Motion has not stayed inactive long enough since last check: doing nothing" } } else { log.debug "Motion is active, do nothing and wait for inactive"