From 70611b774648e498ffaf327878c2db99a0e6cf9a Mon Sep 17 00:00:00 2001 From: Laurent Garnier Date: Mon, 28 Oct 2024 01:13:01 +0100 Subject: [PATCH] [a-d] Fix @ActionOutput annotations Related to #17636 Signed-off-by: Laurent Garnier Deconz --- .../binding/astro/internal/action/AstroActions.java | 8 ++++---- .../chromecast/internal/action/ChromecastActions.java | 4 ++-- .../binding/deconz/internal/action/GroupActions.java | 6 ++++-- .../binding/doorbird/internal/action/DoorbirdActions.java | 8 ++++---- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/action/AstroActions.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/action/AstroActions.java index 687668763ca0f..f157e2d4cbe2b 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/action/AstroActions.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/action/AstroActions.java @@ -66,7 +66,7 @@ public void setThingHandler(@Nullable ThingHandler handler) { } @RuleAction(label = "get the azimuth", description = "Get the azimuth for a given time.") - public @Nullable @ActionOutput(name = "getAzimuth", label = "Azimuth", type = "org.openhab.core.library.types.QuantityType") QuantityType getAzimuth( + public @Nullable @ActionOutput(name = "result", label = "Azimuth", type = "org.openhab.core.library.types.QuantityType") QuantityType getAzimuth( @ActionInput(name = "date", label = "Date", required = false, description = "Considered date") @Nullable ZonedDateTime date) { logger.debug("Astro action 'getAzimuth' called"); AstroThingHandler theHandler = this.handler; @@ -79,7 +79,7 @@ public void setThingHandler(@Nullable ThingHandler handler) { } @RuleAction(label = "get the elevation", description = "Get the elevation for a given time.") - public @Nullable @ActionOutput(name = "getElevation", label = "Elevation", type = "org.openhab.core.library.types.QuantityType") QuantityType getElevation( + public @Nullable @ActionOutput(name = "result", label = "Elevation", type = "org.openhab.core.library.types.QuantityType") QuantityType getElevation( @ActionInput(name = "date", label = "Date", required = false, description = "Considered date") @Nullable ZonedDateTime date) { logger.debug("Astro action 'getElevation' called"); AstroThingHandler theHandler = this.handler; @@ -92,7 +92,7 @@ public void setThingHandler(@Nullable ThingHandler handler) { } @RuleAction(label = "get the total sun radiation", description = "Get the total sun radiation for a given time.") - public @Nullable @ActionOutput(name = "getTotalRadiation", label = "Total Radiation", type = "org.openhab.core.library.types.QuantityType") QuantityType getTotalRadiation( + public @Nullable @ActionOutput(name = "result", label = "Total Radiation", type = "org.openhab.core.library.types.QuantityType") QuantityType getTotalRadiation( @ActionInput(name = "date", label = "Date", required = false, description = "Considered date") @Nullable ZonedDateTime date) { logger.debug("Astro action 'getTotalRadiation' called"); AstroThingHandler theHandler = this.handler; @@ -110,7 +110,7 @@ public void setThingHandler(@Nullable ThingHandler handler) { } @RuleAction(label = "get the date time of a sun event", description = "Get the date time of a sun event.") - public @Nullable @ActionOutput(name = "getEventTime", type = "java.time.ZonedDateTime") ZonedDateTime getEventTime( + public @Nullable @ActionOutput(name = "result", label = "Event Time", type = "java.time.ZonedDateTime") ZonedDateTime getEventTime( @ActionInput(name = "phaseName", label = "Phase", required = true, description = "Requested phase") String phaseName, @ActionInput(name = "date", label = "Date", required = false, description = "Considered date") @Nullable ZonedDateTime date, @ActionInput(name = "moment", label = "Moment", required = false, defaultValue = "START", description = "Either START or END") @Nullable String moment) { diff --git a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/action/ChromecastActions.java b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/action/ChromecastActions.java index a585dcecdafd8..7e313aac12006 100644 --- a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/action/ChromecastActions.java +++ b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/action/ChromecastActions.java @@ -41,7 +41,7 @@ public class ChromecastActions implements ThingActions { private @Nullable ChromecastHandler handler; @RuleAction(label = "@text/playURLActionLabel", description = "@text/playURLActionDescription") - public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean playURL( + public @ActionOutput(name = "result", label = "Success", type = "java.lang.Boolean") Boolean playURL( @ActionInput(name = "url") @Nullable String url) { if (url == null) { logger.warn("Cannot Play as URL is missing."); @@ -58,7 +58,7 @@ public class ChromecastActions implements ThingActions { } @RuleAction(label = "@text/playURLTypeActionLabel", description = "@text/playURLTypeActionDescription") - public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean playURL( + public @ActionOutput(name = "result", label = "Success", type = "java.lang.Boolean") Boolean playURL( @ActionInput(name = "url") @Nullable String url, @ActionInput(name = "mediaType") @Nullable String mediaType) { if (url == null) { diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/action/GroupActions.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/action/GroupActions.java index 386a0703a52b7..82826e43e8802 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/action/GroupActions.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/action/GroupActions.java @@ -27,6 +27,7 @@ import org.openhab.binding.deconz.internal.handler.GroupThingHandler; import org.openhab.core.automation.annotation.ActionInput; import org.openhab.core.automation.annotation.ActionOutput; +import org.openhab.core.automation.annotation.ActionOutputs; import org.openhab.core.automation.annotation.RuleAction; import org.openhab.core.thing.binding.ThingActions; import org.openhab.core.thing.binding.ThingActionsScope; @@ -59,8 +60,9 @@ public class GroupActions implements ThingActions { private @Nullable GroupThingHandler handler; @RuleAction(label = "@text/action.create-scene.label", description = "@text/action.create-scene.description") - public @ActionOutput(name = NEW_SCENE_ID_OUTPUT, type = "java.lang.Integer") Map createScene( - @ActionInput(name = "name", label = "@text/action.create-scene.name.label", description = "@text/action.create-scene.name.description") @Nullable String name) { + public @ActionOutputs({ + @ActionOutput(name = NEW_SCENE_ID_OUTPUT, label = "Scene Id", type = "java.lang.Integer") }) Map createScene( + @ActionInput(name = "name", label = "@text/action.create-scene.name.label", description = "@text/action.create-scene.name.description") @Nullable String name) { GroupThingHandler handler = this.handler; if (handler == null) { diff --git a/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/action/DoorbirdActions.java b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/action/DoorbirdActions.java index e4121e8a94a39..b6a0f9085254a 100644 --- a/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/action/DoorbirdActions.java +++ b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/action/DoorbirdActions.java @@ -85,7 +85,7 @@ public static void sipHangup(ThingActions actions) { } @RuleAction(label = "get the ring time limit", description = "Get the value of RING_TIME_LIMIT.") - public @ActionOutput(name = "getRingTimeLimit", type = "java.lang.String") String getRingTimeLimit() { + public @ActionOutput(name = "result", label = "Ring Time Limit", type = "java.lang.String") String getRingTimeLimit() { logger.debug("Doorbird action 'getRingTimeLimit' called"); DoorbellHandler handler = this.handler; if (handler != null) { @@ -101,7 +101,7 @@ public static String getRingTimeLimit(ThingActions actions) { } @RuleAction(label = "get the call time limit", description = "Get the value of CALL_TIME_LIMIT.") - public @ActionOutput(name = "getCallTimeLimit", type = "java.lang.String") String getCallTimeLimit() { + public @ActionOutput(name = "result", label = "Call Time Limit", type = "java.lang.String") String getCallTimeLimit() { logger.debug("Doorbird action 'getCallTimeLimit' called"); DoorbellHandler handler = this.handler; if (handler != null) { @@ -117,7 +117,7 @@ public static String getCallTimeLimit(ThingActions actions) { } @RuleAction(label = "get the last error code", description = "Get the value of LASTERRORCODE.") - public @ActionOutput(name = "getLastErrorCode", type = "java.lang.String") String getLastErrorCode() { + public @ActionOutput(name = "result", label = "Last Error Code", type = "java.lang.String") String getLastErrorCode() { logger.debug("Doorbird action 'getLastErrorCode' called"); DoorbellHandler handler = this.handler; if (handler != null) { @@ -133,7 +133,7 @@ public static String getLastErrorCode(ThingActions actions) { } @RuleAction(label = "get the last error text", description = "Get the value of LASTERRORTEXT.") - public @ActionOutput(name = "getLastErrorText", type = "java.lang.String") String getLastErrorText() { + public @ActionOutput(name = "result", label = "Last Error Text", type = "java.lang.String") String getLastErrorText() { logger.debug("Doorbird action 'getLastErrorText' called"); DoorbellHandler handler = this.handler; if (handler != null) {