From bb6f6515ec1f4b2d17283970a9b2562b43a28bb1 Mon Sep 17 00:00:00 2001 From: Seyed Amir Hossein Aqajari Date: Sun, 4 Aug 2019 18:48:50 -0700 Subject: [PATCH] Update loft.groovy --- third-party/loft.groovy | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/third-party/loft.groovy b/third-party/loft.groovy index 4e41ab9..7b1368e 100755 --- a/third-party/loft.groovy +++ b/third-party/loft.groovy @@ -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() -- 2.34.1