From: bdemsky Date: Wed, 7 Aug 2019 02:28:36 +0000 (-0700) Subject: Value filtering finished X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5281938bd04f310691e7da74cbd057b6ed3dab8c;p=smartthings-infrastructure.git Value filtering finished --- diff --git a/Methods/eventHandler.groovy b/Methods/eventHandler.groovy index ca13fa3..e8ae2be 100644 --- a/Methods/eventHandler.groovy +++ b/Methods/eventHandler.groovy @@ -11,7 +11,8 @@ def eventHandler(LinkedHashMap eventDataMap) { def data = eventDataMap["data"] for (int i = 0;i < app2.eventList.size();i++) { - if (app2.eventList[i] == name) { + if (app2.eventList[i] == name && + (app2.valueList[i] == "" || app2.valueList == value)) { def event = new Event(value, name, deviceId, descriptionText, displayed, linkText, linkText, isStateChange, unit, data) if (app2.functionList[i] instanceof String) { String toCall = app2.functionList[i] @@ -23,8 +24,9 @@ def eventHandler(LinkedHashMap eventDataMap) { } for (int i = 0;i < app1.eventList.size();i++) { - if (app1.eventList[i] == name) { - def event = new Event(value, name, deviceId, descriptionText, displayed, linkText, linkText, isStateChange, unit, data) + if (app1.eventList[i] == name && + (app1.valueList[i] == "" || app1.valueList == value)) { + def event = new Event(value, name, deviceId, descriptionText, displayed, linkText, linkText, isStateChange, unit, data) if (app1.functionList[i] instanceof String) { String toCall = app1.functionList[i] app1."$toCall"(event)