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

[visualcrossing] Add missing @ActionOutput annotation #17665

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand All @@ -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);
}
}