From 4bf4f8fd3eba52f1fe0b841e9b482c3a3866c7ab Mon Sep 17 00:00:00 2001 From: Jimmy Tanagra Date: Thu, 13 Jun 2024 17:08:07 +1000 Subject: [PATCH] RulesDSL: add DateTimeTrigger offset Signed-off-by: Jimmy Tanagra --- .../core/model/rule/runtime/internal/DSLRuleProvider.java | 1 + .../src/org/openhab/core/model/rule/Rules.xtext | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.core.model.rule.runtime/src/org/openhab/core/model/rule/runtime/internal/DSLRuleProvider.java b/bundles/org.openhab.core.model.rule.runtime/src/org/openhab/core/model/rule/runtime/internal/DSLRuleProvider.java index da92c9fe0ad..8ca56d552aa 100644 --- a/bundles/org.openhab.core.model.rule.runtime/src/org/openhab/core/model/rule/runtime/internal/DSLRuleProvider.java +++ b/bundles/org.openhab.core.model.rule.runtime/src/org/openhab/core/model/rule/runtime/internal/DSLRuleProvider.java @@ -393,6 +393,7 @@ private String removeIndentation(String script) { Configuration cfg = new Configuration(); cfg.put("itemName", tt.getItem()); cfg.put("timeOnly", tt.isTimeOnly()); + cfg.put("offset", tt.getOffset()); return TriggerBuilder.create().withId(Integer.toString((triggerId++))).withTypeUID("timer.DateTimeTrigger") .withConfiguration(cfg).build(); } else if (t instanceof EventEmittedTrigger eeTrigger) { diff --git a/bundles/org.openhab.core.model.rule/src/org/openhab/core/model/rule/Rules.xtext b/bundles/org.openhab.core.model.rule/src/org/openhab/core/model/rule/Rules.xtext index 5847e136d7f..4da038fca50 100644 --- a/bundles/org.openhab.core.model.rule/src/org/openhab/core/model/rule/Rules.xtext +++ b/bundles/org.openhab.core.model.rule/src/org/openhab/core/model/rule/Rules.xtext @@ -76,7 +76,7 @@ TimerTrigger: ; DateTimeTrigger: - 'Time' 'is' item=ItemName (timeOnly?='timeOnly')? + 'Time' 'is' item=ItemName (timeOnly?='timeOnly')? ('offset' offset=INT)? ; SystemTrigger: