-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Thing actions with @ActionOutput annotation to be checked and fixed if necessary #17636
Comments
Related to openhab#17636 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab#17636 Signed-off-by: Laurent Garnier <[email protected]> Deconz
Related to #17636 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab#17636 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab#17636 Signed-off-by: Laurent Garnier <[email protected]>
Related to #17636 Signed-off-by: Laurent Garnier <[email protected]>
Related to #17636 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab#17636 Signed-off-by: Laith Budairi <[email protected]>
Related to openhab#17636 Signed-off-by: Laith Budairi <[email protected]>
Related to #17636 Signed-off-by: Laith Budairi <[email protected]> Co-authored-by: Laith Budairi <[email protected]>
Related to openhab#17636 Signed-off-by: Laurent Garnier <[email protected]>
Related to #17636 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab#17636 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab#17636 Signed-off-by: Laurent Garnier <[email protected]>
Related to #17636 Signed-off-by: Laurent Garnier <[email protected]>
Related to #17636 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab#17636 Signed-off-by: Laith Budairi <[email protected]>
Related to #17636 Signed-off-by: Laith Budairi <[email protected]>
I will have to check the i18n entries for the 6 bindings using @text for the label of output to be sure that the label is "consistent": pushover, pushsafer, satel, tplinksmarthome, tr064 and velux. And then will remain the only binding that did unusual things with the output actions: energidataservice from @jlaur ;) @florian-h05 your help will be appreciated, I have no clear idea how to annotate all these actions outputs. |
I will have to think about that, not so easy. |
I would prefer to stick with
That would be a breaking change and make it more cumbersome to be used in rules, which, after all, is the purpose of having these actions. In general it's nice if the UI can support some of these actions so users can try them out, but they only provide real value in rules. Also, it's not really user-friendly anyway to have to provide e.g. timestamp as "2024-10-30T13:54:00Z" because the actions take |
Good idea, I believe we can easily do that @florian-h05 ? |
I'm not sure if zone should be taken from |
I will try to answer anything relevant, but due to the high number of messages I maybe miss something. Just ask me again in that case.
You need to give them different labels/descriptions to let the user know which takes which params, otherwise there are multiple „same“ entries in the actions list.
If the config description parameter has set
The UI won‘t like that and will print a warning to the log during rendering, but it will display them anyway. Just see Jacob‘s screenshot in #17636 (comment).
If they are not present in the output, the UI will show nothing for them.
I am planning to do that once we are done here.
Add Astro to the list, as it returns QuantityType.
I would convert BigDecimal to a double value inside core, as this only affects action callings from the UI and if the action is used as module in UI-based rules (where the output cannot be used at the moment), so I don‘t see a problem with the decreased precision, as the output won‘t be used for any calculations. And having support for QuantityType would be nice as well.
Couldn‘t we just use the
We haven‘t obtained it at all until now I think, if one had to enter a time or date(time) and it was without zone information (e.g. LocalTime), it was always expected to be the server timezone. For DateTime Items, the UI adds zone information I think and then it likely is the zone of the UI. But in general I would always expect the server time zone, to let‘s use TimeZoneProvider. |
I just tried to create two actions with the same label/description like that:
And UI shows the two actions:
Now if I keep same label/description but rename my java method name, then it works well.
It looks like the core framework is not able to retrieve the right method in case of same label and same method name. |
As few actions have But I doubt UI can support List of anything... |
In fact, we have only two bindings using
energidataservice uses |
Currently only raw strings and selection of Items, Things etc.
I would think yes. |
It is not possible to have several actions with the same method name and the same scope because they will have same id in the registry. @florian-h05 : it is a serious problem as several bindings including energidataservice, chromecast, ecobee, ... etc use sometimes the same method name for different actions. Renaming methods is certainly a breaking change for use in rules ? |
@florian-h05 : I know that you plan to update documentation, the constraint on different method names should be clearly documented. |
Can you fix the API?
Definitely. |
I don't know how ! |
One option could be to introduce an optional "name" to the thing action annotation. If set, it will override the method name. |
Sounds like a good idea 👍 |
What remains for Energi Data Service is to fix these warnings, probably by removing annotations?
|
There is apparently also a visibility field so we could hide some actions by setting it to HIDDEN. To be investigated. |
Related to openhab#17636 Signed-off-by: Laurent Garnier <[email protected]>
We still have "Method EnergiDataServiceActions::getPrices has a single output but does not use the default output name in the ActionOutput annotation. This should be fixed in the binding." with my current PR. Either we avoid this log in core framework when the action is hidden, or I propose to remove action annotations for these 2 methods. WDYT ? |
I would suggest to fix the annotation, see #17679 (comment). |
Related to openhab#17636 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab#17636 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab#17636 Signed-off-by: Laurent Garnier <[email protected]>
…7656) Related to openhab#17636 Signed-off-by: Laith Budairi <[email protected]> Co-authored-by: Laith Budairi <[email protected]>
Related to openhab#17636 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab#17636 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab#17636 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab#17636 Signed-off-by: Laith Budairi <[email protected]>
Related to #17636 Signed-off-by: Laurent Garnier <[email protected]>
All bindings have been fixed. |
Here is the list of bindings containing thing actions with
@ActionOutput
.They all have to be checked and fixed if necessary as discussed in #17504
The text was updated successfully, but these errors were encountered: