- if (app1.eventList[i] == name) {
- def event = new Event(value, name, deviceId, descriptionText, displayed, linkText, linkText, isStateChange, unit, data)
- evt.add(event)
- app1.functionList[i](event)
+ if (app1.eventList[i] == name &&
+ (app1.valueList[i] == "" || app1.valueList[i] == 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)
+ }
+ else
+ app1.functionList[i](event)