X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=Methods%2Fsubscribe.groovy;h=d77c88f60580917b2def0888ac39a1fa495eee1d;hb=2d26e7af07daad1394408bdcf76150b5aacf3a8a;hp=a387375c849ab7ff53354342977bf939ff4316c3;hpb=83071d3bcfc33f015ece13868342644498a9dda3;p=smartthings-infrastructure.git diff --git a/Methods/subscribe.groovy b/Methods/subscribe.groovy index a387375..d77c88f 100644 --- a/Methods/subscribe.groovy +++ b/Methods/subscribe.groovy @@ -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('.')