-
-
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 missing @ActionOutput annotation #17504
Comments
Also fix the methods sendTelegramAnimation for DSL rules that were calling sendTelegramVideo actions. Related to openhab#17504 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Related to openhab#17504 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Also fix the methods sendTelegramAnimation for DSL rules that were calling sendTelegramVideo actions. Related to #17504 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
* [solarforecast] Add missing @ActionOutput annotation Related to #17504 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Also fix the methods sendTelegramAnimation for DSL rules that were calling sendTelegramVideo actions. Related to openhab#17504 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
* [solarforecast] Add missing @ActionOutput annotation Related to openhab#17504 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Also fix the methods sendTelegramAnimation for DSL rules that were calling sendTelegramVideo actions. Related to openhab#17504 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
* [solarforecast] Add missing @ActionOutput annotation Related to openhab#17504 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
According to the linked fronius PR, it needs to be discussed wether Main question her is if there is a core PR to be expect that is going to proces this in the near future. |
With the current core codebase, the Even if |
When I checked the add-ons codebase, all actions with a return had |
And |
And for none of those bindings the Thing actions API returns anything in the outputs array — when playing around with Astro I noticed that and checked the core code. For actions returning a single value I agree with the code that there is no info needed …
I am not sure if there are any actions that return a Map<String, Object> as written down in the docs.
I think so. FYI this is how output annotations are currently processed: Maybe a bit off topic here: Core also limits the allowed return values from actions inside its code, but for scripts it is super useful to have other return values than the allowed ones. However can these mostly not be shown in the UI, so we either need to serialise them properly or hide those actions from the UI. |
EDIT: FYI The output class of that action should be determinable by core without having it in the annotation, this is already done for action inputs that don’t specify the type in the annotation. Will check if core does that for the output as well. And add the
WDYT? |
@lolodomo I have now found a good reason to keep the single ActionOutput annotation for actions returning a single value, WDYT? |
Looking at the processing code you linked to above I wonder
|
Very good argument.
Yes, I agree, "result" should be used as output name in bindings when the action returns only one output. For actions returning several outputs, they should use a
I tend to agree with @maniac103 , do we really need this |
I agree - Success can still be set as label so the UI displays Success true or Success false.
What with actions returning e.g. a Map<Instant, QuantityType>? I see the benefit of allowing those return types for rules, but the UI cannot use them. I think we should hide them from the UI, WDYT?
I don't see a technical reason for this, but prefer the style of having one annotation wrapping multiple annotations instead of having multiple annotations just there. |
Yes. If you deal with core changes, I can prepare a PR for add-ons.
Yes, I agree.
We have 108 +2 actions to fix in that case ! All actions that returns something. |
I meant to only wrap |
I don't know how you count 8 bindings. I am counting 23 bindings.
|
Ok, in that case it reduces the changes. |
This covers bindings that need to wrap multiple |
Yes, this is what I identified in this issue. 4 bindings were concerned, still 2 needs to be fixed. |
That clears up my questions above, thanks 👍 |
… value & Enforce proper annotations See discussion in openhab/openhab-addons#17504 (comment). This adds processing of the ActionOutput annotation for Thing actions with a single return value, which allows providing a label for use in the UI. The output name for those actions is "result", which is now the default value in the @ActionOutput annotation. If a binding overrides the default name, a warning is logged. If a Thing action returns a Map<String, Object> but does not provide the @ActionOutputs annotation, a warning is logged. Signed-off-by: Florian Hotze <dev@florianhotze.com>
@lolodomo See openhab/openhab-core#4430 for the core changes. |
… value & Enforce proper annotations See discussion in openhab/openhab-addons#17504 (comment). This adds processing of the ActionOutput annotation for Thing actions with a single return value, which allows providing a label for use in the UI. The output name for those actions is "result", which is now the default value in the @ActionOutput annotation. If a binding overrides the default name, a warning is logged. If a Thing action returns a Map<String, Object> but does not provide the @ActionOutputs annotation, a warning is logged. Signed-off-by: Florian Hotze <dev@florianhotze.com>
… value & Enforce proper annotations (#4430) See discussion in openhab/openhab-addons#17504 (comment). This adds processing of the ActionOutput annotation for Thing actions with a single return value, which allows providing a label for use in the UI. The output name for those actions is "result", which is now the default value in the @ActionOutput annotation. If a binding overrides the default name, a warning is logged. If a Thing action returns a Map<String, Object> but does not provide the @ActionOutputs annotation, a warning is logged. Signed-off-by: Florian Hotze <dev@florianhotze.com>
Related to openhab#17504 Also fix the return of corresponding static methods Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Related to openhab#17504 Also fix the return of corresponding static methods Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Related to #17504 Also fix the return of corresponding static methods Signed-off-by: Laurent Garnier <lg.hc@free.fr>
As discussed in openhab#17504. Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
As discussed in openhab#17504. Signed-off-by: Florian Hotze <dev@florianhotze.com>
Related to openhab#17504 Also fix the return of corresponding static methods Signed-off-by: Laurent Garnier <lg.hc@free.fr>
…ired (openhab#17623) * [fronius] Symo Inverter actions: Return boolean to indicate success/failure * [fronius] Symo Inverter actions: Annotate all inputs as required * [fronius] Add `@ActionOutput` annotation As discussed in openhab#17504. Signed-off-by: Florian Hotze <dev@florianhotze.com>
Related to openhab#17504 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Related to #17504 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
All completed |
Related to openhab#17504 Also fix the return of corresponding static methods Signed-off-by: Laurent Garnier <lg.hc@free.fr>
…ired (openhab#17623) * [fronius] Symo Inverter actions: Return boolean to indicate success/failure * [fronius] Symo Inverter actions: Annotate all inputs as required * [fronius] Add `@ActionOutput` annotation As discussed in openhab#17504. Signed-off-by: Florian Hotze <dev@florianhotze.com>
Related to openhab#17504 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
We have 4 bindings that do not declare properly the output of thing actions. The annotation
@ActionOutput
is missing.The text was updated successfully, but these errors were encountered: