-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
HostRule is missing type definition #345
Comments
IMO JSRule should rather return nothing, I don’t see a usecase where the return value is needed. |
My use case is that I want to get the generated UID after creating the rule. |
I would rather manually set the UID of the rule than getting it afterwards. |
And I would rather rely on the library to ensure valid and unique names 😉 |
Those names are however „unpredictable“ which indeed is a problem when using the UI to manually trigger the rule. The thing is, I don’t want do document the return value of JSRule because I don’t want to encourage users to use the returned object. I would instead propose to have JSRule just return the UID of the created rule. |
Returning the UID would be fine for my use case, but it might not be for others. What about writing a wrapper around the Java |
As said above: I don’t want to maintain this additional code, which use case I consider fairly limited. |
The raw Java rule provides: getActions: JSRules have only one action, and this is the execute callback. So as you can see it is only the UID getter that is useful. |
rules.JsRule({...});
returns aHostRule
, butHostRule
is only defined asobject
with a documentation link to https://www.openhab.org/javadoc/latest/org/openhab/core/automation/rule.It would be good if the complete type for
HostRule
would be provided.The text was updated successfully, but these errors were encountered: