From 5281938bd04f310691e7da74cbd057b6ed3dab8c Mon Sep 17 00:00:00 2001 From: bdemsky Date: Tue, 6 Aug 2019 19:28:36 -0700 Subject: [PATCH] Value filtering finished --- Methods/eventHandler.groovy | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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) -- 2.34.1