Add offset and timeOnly config in TimerEvent payload (#4378)

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
This commit is contained in:
jimtng 2024-09-16 05:20:29 +10:00 committed by GitHub
parent 92f5baea10
commit 3c7b4b89b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -123,7 +123,8 @@ public class DateTimeTriggerHandler extends BaseTriggerModuleHandler
ModuleHandlerCallback callback = this.callback;
if (callback instanceof TriggerHandlerCallback triggerHandlerCallback) {
TimerEvent event = AutomationEventFactory.createTimerEvent(module.getTypeUID(),
Objects.requireNonNullElse(module.getLabel(), module.getId()), Map.of(CONFIG_ITEM_NAME, itemName));
Objects.requireNonNullElse(module.getLabel(), module.getId()),
Map.of(CONFIG_ITEM_NAME, itemName, CONFIG_TIME_ONLY, timeOnly, CONFIG_OFFSET, offset));
triggerHandlerCallback.triggered(module, Map.of("event", event));
} else {
logger.debug("Tried to trigger, but callback isn't available!");