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

Add triggeringThing name to DSL rules #2756

Merged
merged 2 commits into from
Feb 13, 2022

Conversation

jamesmelville
Copy link
Contributor

I wanted to be able to detect which thing had triggered a DSL rule in order to write rules which used a single set of functionality when detecting that one of many things had gone offline. Whilst I was at it I figured it might be useful to include the previous and new statuses and remove the reference to previousState which didn't seem to make sense. I've tried to follow the pattern in the code and this PR #2567

Signed-off-by: James Melville <jamesmelville@gmail.com>
Signed-off-by: James Melville <jamesmelville@gmail.com>
@jamesmelville jamesmelville requested a review from a team as a code owner February 12, 2022 21:13
@jamesmelville
Copy link
Contributor Author

Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, thanks for the addition.
Could you please also create a PR to add these new implicit vars to the docs at https://www.openhab.org/docs/configuration/rules-dsl.html#implicit-variables-inside-the-execution-block?

@kaikreuzer kaikreuzer merged commit 805f223 into openhab:main Feb 13, 2022
@kaikreuzer kaikreuzer added this to the 3.3 milestone Feb 13, 2022
@kaikreuzer kaikreuzer added the enhancement An enhancement or new feature of the Core label Feb 13, 2022
jamesmelville added a commit to jamesmelville/openhab-docs that referenced this pull request Feb 13, 2022
Changes made in openhab/openhab-core#2756

Signed-off-by: James Melville <jamesmelville@gmail.com>
@cweitkamp cweitkamp added the DSL rules Domain-Specific Language rules label Feb 14, 2022
Confectrician pushed a commit to openhab/openhab-docs that referenced this pull request Feb 15, 2022
Changes made in openhab/openhab-core#2756

Signed-off-by: James Melville <jamesmelville@gmail.com>
@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/oh3-getting-triggeringitemname-and-previousstate-of-thing-changed/128794/8

@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/get-event-triggering-thing/134588/5

splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 12, 2023
* Add triggeringThing name to DSL rules
* Include previous and new statuses

Signed-off-by: James Melville <jamesmelville@gmail.com>
GitOrigin-RevId: 805f223
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DSL rules Domain-Specific Language rules enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants