Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DateTime trigger syntax to not break the equals function in the execution script #2996

Merged
merged 1 commit into from
Jun 6, 2022

Conversation

kaikreuzer
Copy link
Member

This fixes a critical regression caused by #2963, which made the equals method disfunctional within rules.

This resulted in log messages like:

2022-06-06 11:30:46.587 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'test.rules' has errors, therefore ignoring it: [91,83]: no viable alternative at input 'equals'

It seems that Xtext is able to parse everything, if we use the same vocabulary as for the TimerTrigger, i.e. "is". The only drawback might be that the DateTime trigger cannot be used with items of name midnight or noon, but I think this is acceptable.

Signed-off-by: Kai Kreuzer kai@openhab.org

…xecution script

Signed-off-by: Kai Kreuzer <kai@openhab.org>
@kaikreuzer kaikreuzer added bug An unexpected problem or unintended behavior of the Core critical labels Jun 6, 2022
@kaikreuzer kaikreuzer requested a review from a team as a code owner June 6, 2022 18:42
@J-N-K
Copy link
Member

J-N-K commented Jun 6, 2022

Interesting. IIRC it didn't work for me with is, that's why I choose equals.

@kaikreuzer
Copy link
Member Author

I only tested it within my IDE, but there it seemed to work. And compilation definitely worked, so Xtext does not see any conflict in the definition.

@J-N-K
Copy link
Member

J-N-K commented Jun 6, 2022

I'm currently compiling your change locally to check that it also works in a regular runtime.

@J-N-K J-N-K merged commit e69b9a7 into openhab:main Jun 6, 2022
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab-3-3-milestone-discussion/132715/159

@kaikreuzer kaikreuzer deleted the dteq branch June 7, 2022 05:31
@kaikreuzer kaikreuzer added this to the 3.3 milestone Jun 7, 2022
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/error-no-viable-alternative-at-input-equals-after-upgrade-from-3-3-0-m3-to-3-3-0-m6/136592/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of the Core critical
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants