You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
It seems like you already have some of code for it, so once you are ready you could submit a PR.
I'm a bit curious how this is to be used?
I take it, It could be done manually in a rule like this:
@JRuleName("testDateTimeTrigger")
@JRuleWhen(item = _TestDateTime.ITEM, trigger = _TestDateTime.TRIGGER_CHANGED)
publicsynchronizedvoidtestDateTimeItem(JRuleEventevent) {
logInfo("TestDataTmeItem changed from: {} to: {}", event.getOldValue(), event.getNewValue());
// Create a timer with a lambda that triggers given the dateTime change
}
But I take it you want this to be built in like:
@JRuleName("testDateTimeTrigger")
@JRuleWhen(item = _TestDateTime.ITEM, trigger = _TestDateTime.TRIGGER_AT)
publicsynchronizedvoidtestDateTimeItem(JRuleEventevent) {
// Triggered at TestDateTime value
}
You could look at the cron and time based code (Example 11 and 16), to see how they are rescheduled the timer, should be something similar that has to be done.
In Openhab 3 it is possible to trigger a rule with a DateTime item. It is a nice and neat feature, I would like to see it in JRule.
As an experiment, I have tried to program some code, see branch AtTrigger at https://github.com/cvdenzen/jrule/tree/AtTrigger. What is missing is a listener to reschedule the rule if the DateTime item changes.
The text was updated successfully, but these errors were encountered: