Update loft.groovy
authorSeyed Amir Hossein Aqajari <amiraj.95@uci.edu>
Mon, 5 Aug 2019 01:48:50 +0000 (18:48 -0700)
committerGitHub Enterprise <noreply@github.uci.edu>
Mon, 5 Aug 2019 01:48:50 +0000 (18:48 -0700)
third-party/loft.groovy

index 4e41ab9675523a8ef47d225058338ef4884b2d9b..7b1368e711dd4c807ffc6317725f9cb15ad0a81f 100755 (executable)
@@ -58,16 +58,16 @@ def updated() {
 }
 
 def initialize() {
-    subscribe(monitor_switches, "switch", eventHandler)
-    subscribe(monitor_motion, "motion", eventHandler)
-    subscribe(monitor_presence, "presence", eventHandler)
-    subscribe(location, "mode", eventHandler)
-    subscribe(location, "sunset", eventHandler)
-    subscribe(location, "sunrise", eventHandler)
+    subscribe(monitor_switches, "switch", eventHandler1)
+    subscribe(monitor_motion, "motion", eventHandler1)
+    subscribe(monitor_presence, "presence", eventHandler1)
+    subscribe(location, "mode", eventHandler1)
+    subscribe(location, "sunset", eventHandler1)
+    subscribe(location, "sunrise", eventHandler1)
     tick()
 }
 
-def eventHandler(evt) {
+def eventHandler1(evt) {
     def everyone_here = presense_is_after(monitor_presence, "present", 10)
     def everyone_gone = presense_is_after(monitor_presence, "not present", 10)
     def current_count = monitor_presence.findAll { it.currentPresence == "present" }.size()