Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the rule UID as an attribute of the Action function
- Loading branch information
Scott Rushworth
committed
Nov 10, 2018
1 parent
a43f72b
commit 00a95b5
Showing
1 changed file
with
3 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
00a95b5
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.
@openhab-5iver , Looks good to me, thanks for asking me to review. I think there may be an issue in the assignment on line 57, shouldn't the UID of the new rule be accessed using getUID()?
https://github.com/eclipse/smarthome/blob/master/bundles/automation/org.eclipse.smarthome.automation.api/src/main/java/org/eclipse/smarthome/automation/Rule.java#L54
My only other comment is that in my local copy of rules.py, I changed the name of the function variable to callable_obj in order to make it clear (to me, anyway) that the object being decorated may be any callable object, not just a function or a class. In my uses of the rule decorator, I decorate callable instances of a class, not a function or a class. Excerpt from my local copy of rules.py: