diff --git a/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/RuleTriggerManager.java b/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/RuleTriggerManager.java index 422bf063122..bd6ec3f2e0d 100644 --- a/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/RuleTriggerManager.java +++ b/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/RuleTriggerManager.java @@ -232,7 +232,7 @@ public Iterable getRules(TriggerTypes triggerType, String channel, String EventEmittedTrigger et = (EventEmittedTrigger) t; if (et.getChannel().equals(channel) - && (et.getTrigger() == null || et.getTrigger().getValue().equals(event))) { + && (et.getTrigger() == null || et.getTrigger().equals(event))) { // if the rule does not have a specific event , execute it on any event result.add(rule); } @@ -298,14 +298,14 @@ private void internalGetUpdateRules(String name, Boolean isGroup, List trigger.getNewState().getValue()); + assertTriggerWith(model, TriggerTypes.CHANGE, ChangedEventTrigger.class, trigger -> trigger.getNewState()); } @Test @@ -66,8 +65,7 @@ public void testChangedEventTrigger_withQuotes() throws Exception { " logInfo(\"test says\", \"Boo!\") " + // "end "; - assertTriggerWith(model, TriggerTypes.CHANGE, ChangedEventTrigger.class, - trigger -> trigger.getNewState().getValue()); + assertTriggerWith(model, TriggerTypes.CHANGE, ChangedEventTrigger.class, trigger -> trigger.getNewState()); } @Test @@ -79,8 +77,7 @@ public void testCommandEventTrigger_withoutQuotes() throws Exception { " logInfo(\"test says\", \"Boo!\") " + // "end "; - assertTriggerWith(model, TriggerTypes.COMMAND, CommandEventTrigger.class, - trigger -> trigger.getCommand().getValue()); + assertTriggerWith(model, TriggerTypes.COMMAND, CommandEventTrigger.class, trigger -> trigger.getCommand()); } @Test @@ -92,8 +89,7 @@ public void testCommandEventTrigger_withQuotes() throws Exception { " logInfo(\"test says\", \"Boo!\") " + // "end "; - assertTriggerWith(model, TriggerTypes.COMMAND, CommandEventTrigger.class, - trigger -> trigger.getCommand().getValue()); + assertTriggerWith(model, TriggerTypes.COMMAND, CommandEventTrigger.class, trigger -> trigger.getCommand()); } @Test @@ -105,8 +101,7 @@ public void testEventEmittedTrigger_withoutQuotes() throws Exception { " logInfo(\"test says\", \"Boo!\") " + // "end "; - assertTriggerWith(model, TriggerTypes.TRIGGER, EventEmittedTrigger.class, - trigger -> trigger.getTrigger().getValue()); + assertTriggerWith(model, TriggerTypes.TRIGGER, EventEmittedTrigger.class, trigger -> trigger.getTrigger()); } @Test @@ -118,8 +113,7 @@ public void testEventEmittedTrigger_withQuotes() throws Exception { " logInfo(\"test says\", \"Boo!\") " + // "end "; - assertTriggerWith(model, TriggerTypes.TRIGGER, EventEmittedTrigger.class, - trigger -> trigger.getTrigger().getValue()); + assertTriggerWith(model, TriggerTypes.TRIGGER, EventEmittedTrigger.class, trigger -> trigger.getTrigger()); } private void assertTriggerWith(String model, TriggerTypes triggerType, Class triggerClass,