-
Notifications
You must be signed in to change notification settings - Fork 15
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
enrich memberOf with options to just listen on items or groups #95
Conversation
I like the idea. It would be great if I could get changes about Use case: Motion sensing in different zones of the premises. If I have multiple sensors in |
Also remember to update the README with updated/new examples :) |
Thought about the same and started doing it but reverted it again. Maybe we could this in an additional MR. I have to much open MRs and I have to merge them all again in my own developer branch. This should be simply from the user view with additional enums for JRuleMemberOf |
@querdenker2k could you rebase and resolve conflicts? |
# Conflicts: # src/main/java/org/openhab/automation/jrule/internal/engine/excutioncontext/JRuleItemChangeExecutionContext.java # src/main/java/org/openhab/automation/jrule/internal/engine/excutioncontext/JRuleItemExecutionContext.java # src/main/java/org/openhab/automation/jrule/internal/engine/excutioncontext/JRuleItemReceivedCommandExecutionContext.java # src/main/java/org/openhab/automation/jrule/internal/engine/excutioncontext/JRuleItemReceivedUpdateExecutionContext.java
...st/java/org/openhab/binding/jrule/internal/triggers/itemchange/JRuleGroupItemChangeTest.java
Outdated
Show resolved
Hide resolved
...st/java/org/openhab/binding/jrule/internal/triggers/itemchange/JRuleGroupItemChangeTest.java
Outdated
Show resolved
Hide resolved
...t/java/org/openhab/binding/jrule/internal/triggers/itemchange/JRuleGroupItemChangeRules.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this PR still a draft or ready for review?
not ready yet, have to resolve merge conflicts (therefor the outcommented tests for better debugging) but will not get it to work in the next 5 days. |
# Conflicts: # src/main/java/org/openhab/automation/jrule/internal/engine/excutioncontext/JRuleItemExecutionContext.java # src/main/java/org/openhab/automation/jrule/internal/engine/excutioncontext/JRuleItemReceivedCommandExecutionContext.java # src/main/java/org/openhab/automation/jrule/internal/engine/excutioncontext/JRuleItemReceivedUpdateExecutionContext.java # src/test/java/org/openhab/automation/jrule/rules/user/TestRules.java
Ready again, added IT tests. |
PUSH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not tested, but has unit tests
@querdenker2k Tested this a bit tonight, and something is not correct. I replaced all my When using The event claims to be for group I have also seen my batteryGroup monitoring rules suddenly getting triggered with motion sensor events etc. Not sure where the problem is; either parsing of which groups contains which members or the rule filtering mechanism. Changing from |
Damn, will look into it. Could already create a negative test which describes your behaviour. |
fixed this, problem was very stupid |
Appears to be working as expected now! Thanks @querdenker2k |
@JRuleWhenItemChange(item = GROUP_ITEM, memberOf = true)
changed to
@JRuleWhenItemChange(item = GROUP_ITEM, memberOf = JRuleMemberOf.All)
or
@JRuleWhenItemChange(item = GROUP_ITEM, memberOf = JRuleMemberOf.Items)
or
@JRuleWhenItemChange(item = GROUP_ITEM, memberOf = JRuleMemberOf.Groups)
In some of my rules I have something like that:
To not do this inside the rule method, the rule should just be triggered for Items (and not Groups).
Further on the triggered itemName will be in itemName and not in memberName anymore, because #93