From 8d092dbf0900379495283b9bc0b20ed534098e3b Mon Sep 17 00:00:00 2001 From: Laurent Garnier Date: Tue, 29 Oct 2024 19:53:22 +0100 Subject: [PATCH] [visualcrossing] Add missing @ActionOutput annotation Related to #17504 Also fix the return of corresponding static methods Signed-off-by: Laurent Garnier --- .../internal/WeatherCrossingActions.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/bundles/org.openhab.binding.visualcrossing/src/main/java/org/openhab/binding/visualcrossing/internal/WeatherCrossingActions.java b/bundles/org.openhab.binding.visualcrossing/src/main/java/org/openhab/binding/visualcrossing/internal/WeatherCrossingActions.java index 471ed061e9c98..9c3812d418328 100644 --- a/bundles/org.openhab.binding.visualcrossing/src/main/java/org/openhab/binding/visualcrossing/internal/WeatherCrossingActions.java +++ b/bundles/org.openhab.binding.visualcrossing/src/main/java/org/openhab/binding/visualcrossing/internal/WeatherCrossingActions.java @@ -23,6 +23,7 @@ import org.openhab.binding.visualcrossing.internal.api.VisualCrossingRateException; import org.openhab.binding.visualcrossing.internal.api.dto.WeatherResponse; import org.openhab.core.automation.annotation.ActionInput; +import org.openhab.core.automation.annotation.ActionOutput; import org.openhab.core.automation.annotation.RuleAction; import org.openhab.core.thing.binding.ThingActions; import org.openhab.core.thing.binding.ThingActionsScope; @@ -47,8 +48,7 @@ public void setThingHandler(ThingHandler thingHandler) { } @RuleAction(label = "@text/action.timeline.label", description = "@text/action.timeline.description") - @Nullable - public WeatherResponse timeline( + public @Nullable @ActionOutput(label = "Result", type = "org.openhab.binding.visualcrossing.internal.api.dto.WeatherResponse") WeatherResponse timeline( @ActionInput(name = "location", label = "@text/action.label.location", description = "@text/action.description.location") @Nullable String location, @ActionInput(name = "unitGroup", label = "@text/action.label.unitGroup", description = "@text/action.description.unitGroup") @Nullable UnitGroup unitGroup, @ActionInput(name = "lang", label = "@text/action.label.lang", description = "@text/action.description.lang") @Nullable String lang, @@ -62,21 +62,20 @@ public WeatherResponse timeline( return localHandler.timeline(location, unitGroup, lang, dateFrom, dateTo); } - public static void timeline(@Nullable ThingActions actions, @Nullable String location, + public static @Nullable WeatherResponse timeline(@Nullable ThingActions actions, @Nullable String location, @Nullable UnitGroup unitGroup, @Nullable String lang, @Nullable String dateFrom, @Nullable String dateTo) throws VisualCrossingAuthException, VisualCrossingApiException, VisualCrossingRateException { - ((VisualCrossingHandler) requireNonNull(actions)).timeline(location, unitGroup, lang, dateFrom, dateTo); + return ((VisualCrossingHandler) requireNonNull(actions)).timeline(location, unitGroup, lang, dateFrom, dateTo); } @RuleAction(label = "@text/action.timeline.label", description = "@text/action.timeline.description") - @Nullable - public WeatherResponse timeline() + public @Nullable @ActionOutput(label = "Result", type = "org.openhab.binding.visualcrossing.internal.api.dto.WeatherResponse") WeatherResponse timeline() throws VisualCrossingAuthException, VisualCrossingApiException, VisualCrossingRateException { return timeline(null, null, null, null, null); } - public static void timeline(@Nullable ThingActions actions) + public static @Nullable WeatherResponse timeline(@Nullable ThingActions actions) throws VisualCrossingAuthException, VisualCrossingApiException, VisualCrossingRateException { - ((VisualCrossingHandler) requireNonNull(actions)).timeline(null, null, null, null, null); + return ((VisualCrossingHandler) requireNonNull(actions)).timeline(null, null, null, null, null); } }