From 7d2a505e136101feb41d36fa0b2dd09d11ed97a3 Mon Sep 17 00:00:00 2001 From: Kai Kreuzer Date: Fri, 13 Nov 2020 07:29:56 +0100 Subject: [PATCH] [automation] Correctly map the state context variable of the ItemStateEvent to the implicit var newState (#1809) Fixes #1802 Signed-off-by: Kai Kreuzer --- .../model/script/runtime/internal/engine/DSLScriptEngine.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.core.model.script.runtime/src/org/openhab/core/model/script/runtime/internal/engine/DSLScriptEngine.java b/bundles/org.openhab.core.model.script.runtime/src/org/openhab/core/model/script/runtime/internal/engine/DSLScriptEngine.java index a7f37aeff..6cbe97030 100644 --- a/bundles/org.openhab.core.model.script.runtime/src/org/openhab/core/model/script/runtime/internal/engine/DSLScriptEngine.java +++ b/bundles/org.openhab.core.model.script.runtime/src/org/openhab/core/model/script/runtime/internal/engine/DSLScriptEngine.java @@ -54,7 +54,8 @@ public class DSLScriptEngine implements javax.script.ScriptEngine { public static final String MIMETYPE_OPENHAB_DSL_RULE = "application/vnd.openhab.dsl.rule"; private static final Map implicitVars = Map.of("command", "receivedCommand", "event", - "receivedEvent", "newState", "newState", "oldState", "previousState", "triggeringItem", "triggeringItem"); + "receivedEvent", "state", "newState", "newState", "newState", "oldState", "previousState", "triggeringItem", + "triggeringItem"); private final Logger logger = LoggerFactory.getLogger(DSLScriptEngine.class);