RulesDSL: add DateTimeTrigger offset (#4272)

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
This commit is contained in:
jimtng 2024-09-11 05:20:57 +10:00 committed by GitHub
parent 83b069d970
commit bcda209ec9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -393,6 +393,7 @@ public class DSLRuleProvider
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) {

View File

@ -76,7 +76,7 @@ TimerTrigger:
;
DateTimeTrigger:
'Time' 'is' item=ItemName (timeOnly?='timeOnly')?
'Time' 'is' item=ItemName (timeOnly?='timeOnly')? ('offset' offset=INT)?
;
SystemTrigger: