Removing getXXX methods + properties. Adding getProperty feature to SmartThing(s)
[smartthings-infrastructure.git] / Methods / subscribe.groovy
index a387375c849ab7ff53354342977bf939ff4316c3..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,11 +18,6 @@ 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"
-    } else if (event == "unlocked") {
-      return
     }
     
     int dot = event.indexOf('.')
@@ -44,10 +39,6 @@ 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"
-    } else if (event == "unlocked") {
-       return
     }
 
     int dot = event.indexOf('.')