Commit #8: New version of extractor with running the preferences method make things...
[smartthings-infrastructure.git] / Methods / subscribe.groovy
index 1726fc56ff7b06b6daf8e6711544d9f116a70f30..74f7047e0b64167f2267eb5bd40a82a04628aaf0 100644 (file)
@@ -1,9 +1,15 @@
 /////////////////////////////////////////////////////////////////////
 ////subscribe(obj, func)
 def subscribe(Object obj, Closure FunctionToCall) {
-       objectList.add(obj)
-       eventList.add("Touched")
-       functionList.add(FunctionToCall)
+       if (obj == app) {
+               objectList.add(obj)
+               eventList.add("Touched")
+               functionList.add(FunctionToCall)
+       } else if (obj == location) {
+               objectList.add(obj)
+               eventList.add("Location")
+               functionList.add(FunctionToCall)
+       }
 }
 ////subscribe(obj, event, func)
 def subscribe(Object obj, String event, Closure FunctionToCall) {