Update turn-on-only-if-i-arrive-after-sunset.groovy
authorSeyed Amir Hossein Aqajari <amiraj.95@uci.edu>
Wed, 7 Aug 2019 01:54:25 +0000 (18:54 -0700)
committerGitHub Enterprise <noreply@github.uci.edu>
Wed, 7 Aug 2019 01:54:25 +0000 (18:54 -0700)
official/turn-on-only-if-i-arrive-after-sunset.groovy

index 0c04d4c..9f26bbe 100755 (executable)
@@ -47,11 +47,11 @@ def presenceHandler(evt)
        log.debug current
        def presenceValue = presence1.find{it.currentPresence == "present"}
        log.debug presenceValue
-       if(presenceValue && (now > sunTime.sunset)) {
+       if(presenceValue) {
                switch1.on()
                log.debug "Welcome home at night!"
        }
-    else if(presenceValue && (now < sunTime.sunset)) {
+    else if(presenceValue) {
        log.debug "Welcome home at daytime!"
     }
        else {