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

Memberof trigger #66

Merged
merged 7 commits into from
Nov 5, 2022
Merged

Memberof trigger #66

merged 7 commits into from
Nov 5, 2022

Conversation

querdenker2k
Copy link
Collaborator

Created a memberOf option for item event triggers.
Discussed here: #22
When setting memberOf=true on a group-item the rule will fire for all direct group member events.

@querdenker2k querdenker2k marked this pull request as ready for review October 29, 2022 05:18
@seime
Copy link
Collaborator

seime commented Nov 2, 2022

@querdenker2k I've added an example of how to write trigger tests in #73 - WDYT? I'd love to get more tests in JRule as it is quite annoying to detect bugs only when my home automations quietly breaks after merging the latest code.

This PR is quite big so I expect something to break just by the sheer size of it.

@seime
Copy link
Collaborator

seime commented Nov 2, 2022

And by the way - great work! I've been waiting for this feature - it is the last missing nail in the DSL rule coffin for my setup :)

@querdenker2k
Copy link
Collaborator Author

@querdenker2k I've added an example of how to write trigger tests in #73 - WDYT? I'd love to get more tests in JRule as it is quite annoying to detect bugs only when my home automations quietly breaks after merging the latest code.

This PR is quite big so I expect something to break just by the sheer size of it.

yes, thats really anoying. i created my docker test project for this to test JRule with the real environment as a "blockbox". Maybe we could integrate this kind of testing as well.

@seaside1
Copy link
Owner

seaside1 commented Nov 3, 2022

I'm getting some failed tests when merging with main.
@seime anything obvious?

@seaside1
Copy link
Owner

seaside1 commented Nov 3, 2022

ERROR] Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 1.037 s <<< FAILURE! - in org.openhab.binding.jrule.internal.triggers.itemchange.JRuleItemChangeTest
[ERROR] org.openhab.binding.jrule.internal.triggers.itemchange.JRuleItemChangeTest.testItemChange_from  Time elapsed: 0.76 s  <<< ERROR!
java.lang.NullPointerException
	at org.openhab.binding.jrule.internal.triggers.itemchange.JRuleItemChangeTest.testItemChange_from(JRuleItemChangeTest.java:49)

[ERROR] org.openhab.binding.jrule.internal.triggers.itemchange.JRuleItemChangeTest.testItemChange_no_from_to  Time elapsed: 0.022 s  <<< ERROR!
java.lang.NullPointerException
	at org.openhab.binding.jrule.internal.triggers.itemchange.JRuleItemChangeTest.testItemChange_no_from_to(JRuleItemChangeTest.java:40)

[ERROR] org.openhab.binding.jrule.internal.triggers.itemchange.JRuleItemChangeTest.testItemChange_from_to  Time elapsed: 0.013 s  <<< ERROR!
java.lang.NullPointerException
	at org.openhab.binding.jrule.internal.triggers.itemchange.JRuleItemChangeTest.testItemChange_from_to(JRuleItemChangeTest.java:67)

@seime
Copy link
Collaborator

seime commented Nov 4, 2022

@querdenker2k could you rebase and look at the tests?

@querdenker2k
Copy link
Collaborator Author

Yes will do it tomorrow

@seaside1
Copy link
Owner

seaside1 commented Nov 5, 2022

Merging.

@seaside1 seaside1 merged commit ca9e8ff into seaside1:main Nov 5, 2022
@querdenker2k querdenker2k deleted the memberof_trigger branch November 12, 2022 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants