openhab / openhab-core

Core framework of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
932 stars 429 forks source link

Thing actions: Support `@ActionOutput` for single return values #4430

Closed florian-h05 closed 4 weeks ago

florian-h05 commented 1 month ago

See discussion in https://github.com/openhab/openhab-addons/issues/17504#issuecomment-2439906483.

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.