Skip to content
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: Support @ActionOutput for single return values #4430

Merged
merged 1 commit into from
Oct 27, 2024

Conversation

florian-h05
Copy link
Contributor

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.

… 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 <[email protected]>
Copy link
Member

@J-N-K J-N-K left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@J-N-K J-N-K added the enhancement An enhancement or new feature of the Core label Oct 27, 2024
@J-N-K J-N-K added this to the 4.3 milestone Oct 27, 2024
@J-N-K J-N-K merged commit 7f5fbbb into openhab:main Oct 27, 2024
5 checks passed
@florian-h05 florian-h05 deleted the action-output branch October 27, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants