Skip to content

Commit

Permalink
[a-d] Fix @ActionOutput annotations
Browse files Browse the repository at this point in the history
Related to openhab#17636

Signed-off-by: Laurent Garnier <[email protected]>

Deconz
  • Loading branch information
lolodomo committed Oct 28, 2024
1 parent abe8199 commit 70611b7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<javax.measure.quantity.Angle>") QuantityType<Angle> getAzimuth(
public @Nullable @ActionOutput(name = "result", label = "Azimuth", type = "org.openhab.core.library.types.QuantityType<javax.measure.quantity.Angle>") QuantityType<Angle> getAzimuth(
@ActionInput(name = "date", label = "Date", required = false, description = "Considered date") @Nullable ZonedDateTime date) {
logger.debug("Astro action 'getAzimuth' called");
AstroThingHandler theHandler = this.handler;
Expand All @@ -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<javax.measure.quantity.Angle>") QuantityType<Angle> getElevation(
public @Nullable @ActionOutput(name = "result", label = "Elevation", type = "org.openhab.core.library.types.QuantityType<javax.measure.quantity.Angle>") QuantityType<Angle> getElevation(
@ActionInput(name = "date", label = "Date", required = false, description = "Considered date") @Nullable ZonedDateTime date) {
logger.debug("Astro action 'getElevation' called");
AstroThingHandler theHandler = this.handler;
Expand All @@ -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<org.openhab.core.library.dimension.Intensity>") QuantityType<Intensity> getTotalRadiation(
public @Nullable @ActionOutput(name = "result", label = "Total Radiation", type = "org.openhab.core.library.types.QuantityType<org.openhab.core.library.dimension.Intensity>") QuantityType<Intensity> getTotalRadiation(
@ActionInput(name = "date", label = "Date", required = false, description = "Considered date") @Nullable ZonedDateTime date) {
logger.debug("Astro action 'getTotalRadiation' called");
AstroThingHandler theHandler = this.handler;
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String, Object> 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<String, Object> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 70611b7

Please sign in to comment.