Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git] / Methods / subscribe.groovy
index b60cb4501457ad4bfad618d49072b9acd6c6b015..d77c88f60580917b2def0888ac39a1fa495eee1d 100644 (file)
@@ -8,7 +8,7 @@ def subscribe(Object obj, Closure FunctionToCall) {
                functionList.add(FunctionToCall)
        } else if (obj == location) {
                objectList.add(obj)
-               eventList.add("Location")
+               eventList.add("mode")
                 valueList.add("")
                functionList.add(FunctionToCall)
        }
@@ -18,10 +18,7 @@ def subscribe(Object obj, Closure FunctionToCall) {
 def subscribe(Object obj, String event, Closure FunctionToCall) {
     if (event == "tamper.tampered") {
        event = "contact"      //This really should be its own name
-    } else if ((event == "mode")||(event == "mode.away")||(event == "mode.home")||(event == "mode.night")) {
-       //This really should be fixed also...
-       event = "Location"
-    }       
+    }
     
     int dot = event.indexOf('.')
     String name = ""
@@ -42,9 +39,7 @@ def subscribe(Object obj, String event, Closure FunctionToCall) {
 def subscribe(Object obj, String event, String FunctionToCall) {
     if (event == "tamper.tampered") {
        event = "contact"      //This really should be its own name
-    } else if ((event == "mode")||(event == "mode.away")||(event == "mode.home")||(event == "mode.night")) {
-       event = "Location"
-    }       
+    }
 
     int dot = event.indexOf('.')
     String name = ""