Skip to content

Commit

Permalink
[t*] Fix @ActionOutput annotations (openhab#17666)
Browse files Browse the repository at this point in the history
Related to openhab#17636

Signed-off-by: Laurent Garnier <[email protected]>
  • Loading branch information
lolodomo authored and KaaNee committed Nov 8, 2024
1 parent 0c8f90a commit ebbe25e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public String toString() {
}

@RuleAction(label = "send an answer", description = "Send a Telegram answer using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean sendTelegramAnswer(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean sendTelegramAnswer(
@ActionInput(name = "chatId") @Nullable Long chatId,
@ActionInput(name = "callbackId") @Nullable String callbackId,
@ActionInput(name = "messageId") @Nullable Long messageId,
Expand Down Expand Up @@ -149,7 +149,7 @@ public String toString() {
}

@RuleAction(label = "send an answer", description = "Send a Telegram answer using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean sendTelegramAnswer(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean sendTelegramAnswer(
@ActionInput(name = "chatId") @Nullable Long chatId,
@ActionInput(name = "replyId") @Nullable String replyId,
@ActionInput(name = "message") @Nullable String message) {
Expand Down Expand Up @@ -177,7 +177,7 @@ public String toString() {
}

@RuleAction(label = "send an answer", description = "Send a Telegram answer using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean sendTelegramAnswer(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean sendTelegramAnswer(
@ActionInput(name = "replyId") @Nullable String replyId,
@ActionInput(name = "message") @Nullable String message) {
TelegramHandler localHandler = handler;
Expand All @@ -192,14 +192,14 @@ public String toString() {
}

@RuleAction(label = "send a message", description = "Send a Telegram message using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean sendTelegram(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean sendTelegram(
@ActionInput(name = "chatId") @Nullable Long chatId,
@ActionInput(name = "message") @Nullable String message) {
return sendTelegramGeneral(chatId, message, (String) null);
}

@RuleAction(label = "send a message", description = "Send a Telegram message using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean sendTelegram(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean sendTelegram(
@ActionInput(name = "message") @Nullable String message) {
TelegramHandler localHandler = handler;
if (localHandler != null) {
Expand All @@ -213,7 +213,7 @@ public String toString() {
}

@RuleAction(label = "send a query", description = "Send a Telegram Query using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean sendTelegramQuery(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean sendTelegramQuery(
@ActionInput(name = "chatId") @Nullable Long chatId,
@ActionInput(name = "message") @Nullable String message,
@ActionInput(name = "replyId") @Nullable String replyId,
Expand All @@ -222,7 +222,7 @@ public String toString() {
}

@RuleAction(label = "send a query", description = "Send a Telegram Query using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean sendTelegramQuery(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean sendTelegramQuery(
@ActionInput(name = "message") @Nullable String message,
@ActionInput(name = "replyId") @Nullable String replyId,
@ActionInput(name = "buttons") @Nullable String... buttons) {
Expand Down Expand Up @@ -293,7 +293,7 @@ private boolean sendTelegramGeneral(@Nullable Long chatId, @Nullable String mess
}

@RuleAction(label = "delete a query", description = "Delete a Query using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean deleteTelegramQuery(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean deleteTelegramQuery(
@ActionInput(name = "replyId") @Nullable String replyId) {
if (replyId == null) {
logger.warn("deleteTelegramQuery() - replyId not passed!");
Expand Down Expand Up @@ -327,7 +327,7 @@ private boolean sendTelegramGeneral(@Nullable Long chatId, @Nullable String mess
} // public boolean deleteTelegramQuery(String replyId)

@RuleAction(label = "send a message", description = "Send a Telegram using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean sendTelegram(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean sendTelegram(
@ActionInput(name = "chatId") @Nullable Long chatId,
@ActionInput(name = "message") @Nullable String message,
@ActionInput(name = "args") @Nullable Object... args) {
Expand All @@ -338,7 +338,7 @@ private boolean sendTelegramGeneral(@Nullable Long chatId, @Nullable String mess
}

@RuleAction(label = "send a message", description = "Send a Telegram using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean sendTelegram(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean sendTelegram(
@ActionInput(name = "message") @Nullable String message,
@ActionInput(name = "args") @Nullable Object... args) {
TelegramHandler localHandler = handler;
Expand All @@ -353,15 +353,15 @@ private boolean sendTelegramGeneral(@Nullable Long chatId, @Nullable String mess
}

@RuleAction(label = "send a photo", description = "Send a picture using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean sendTelegramPhoto(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean sendTelegramPhoto(
@ActionInput(name = "chatId") @Nullable Long chatId,
@ActionInput(name = "photoURL") @Nullable String photoURL,
@ActionInput(name = "caption") @Nullable String caption) {
return sendTelegramPhoto(chatId, photoURL, caption, null, null);
}

@RuleAction(label = "send a photo", description = "Send a picture using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean sendTelegramPhoto(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean sendTelegramPhoto(
@ActionInput(name = "chatId") @Nullable Long chatId,
@ActionInput(name = "photoURL") @Nullable String photoURL,
@ActionInput(name = "caption") @Nullable String caption,
Expand Down Expand Up @@ -465,7 +465,7 @@ private boolean sendTelegramGeneral(@Nullable Long chatId, @Nullable String mess
}

@RuleAction(label = "send a photo", description = "Send a Picture using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean sendTelegramPhoto(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean sendTelegramPhoto(
@ActionInput(name = "photoURL") @Nullable String photoURL,
@ActionInput(name = "caption") @Nullable String caption,
@ActionInput(name = "username") @Nullable String username,
Expand All @@ -482,14 +482,14 @@ private boolean sendTelegramGeneral(@Nullable Long chatId, @Nullable String mess
}

@RuleAction(label = "send a photo", description = "Send a Picture using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean sendTelegramPhoto(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean sendTelegramPhoto(
@ActionInput(name = "photoURL") @Nullable String photoURL,
@ActionInput(name = "caption") @Nullable String caption) {
return sendTelegramPhoto(photoURL, caption, null, null);
}

@RuleAction(label = "send animation", description = "Send an Animation using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean sendTelegramAnimation(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean sendTelegramAnimation(
@ActionInput(name = "animationURL") @Nullable String animationURL,
@ActionInput(name = "caption") @Nullable String caption) {
TelegramHandler localHandler = handler;
Expand All @@ -504,7 +504,7 @@ private boolean sendTelegramGeneral(@Nullable Long chatId, @Nullable String mess
}

@RuleAction(label = "send animation", description = "Send an Animation using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean sendTelegramAnimation(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean sendTelegramAnimation(
@ActionInput(name = "chatId") @Nullable Long chatId,
@ActionInput(name = "animationURL") @Nullable String animationURL,
@ActionInput(name = "caption") @Nullable String caption) {
Expand Down Expand Up @@ -571,7 +571,7 @@ private boolean sendTelegramGeneral(@Nullable Long chatId, @Nullable String mess
}

@RuleAction(label = "send video", description = "Send a Video using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean sendTelegramVideo(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean sendTelegramVideo(
@ActionInput(name = "videoURL") @Nullable String videoURL,
@ActionInput(name = "caption") @Nullable String caption) {
TelegramHandler localHandler = handler;
Expand All @@ -586,7 +586,7 @@ private boolean sendTelegramGeneral(@Nullable Long chatId, @Nullable String mess
}

@RuleAction(label = "send video", description = "Send a Video using the Telegram API.")
public @ActionOutput(name = "success", type = "java.lang.Boolean") boolean sendTelegramVideo(
public @ActionOutput(label = "Success", type = "java.lang.Boolean") boolean sendTelegramVideo(
@ActionInput(name = "chatId") @Nullable Long chatId,
@ActionInput(name = "videoURL") @Nullable String videoURL,
@ActionInput(name = "caption") @Nullable String caption) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class TPLinkSmartHomeActions implements ThingActions, ThingHandlerService
private @Nullable SmartHomeHandler handler;

@RuleAction(label = "@text/actions.tplinksmarthome.send.label", description = "@text/actions.tplinksmarthome.send.description")
public @ActionOutput(name = "response", label = "@text/actions.tplinksmarthome.send.response.label", description = "@text/actions.tplinksmarthome.send.response.description", type = "java.lang.String") String send(
public @ActionOutput(label = "@text/actions.tplinksmarthome.send.response.label", description = "@text/actions.tplinksmarthome.send.response.description", type = "java.lang.String") String send(
@ActionInput(name = "command", label = "@text/actions.tplinksmarthome.send.command.label", description = "@text/actions.tplinksmarthome.send.command.description", type = "java.lang.String", required = true) final String command)
throws IOException {
if (handler instanceof SmartHomeHandler) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,27 +62,27 @@ public class FritzboxActions implements ThingActions {
private @Nullable Tr064RootHandler handler;

@RuleAction(label = "@text/phonebookLookupActionLabel", description = "@text/phonebookLookupActionDescription")
public @ActionOutput(name = "name", label = "@text/phonebookLookupActionOutputLabel", description = "@text/phonebookLookupActionOutputDescription", type = "java.lang.String") String phonebookLookup(
public @ActionOutput(label = "@text/phonebookLookupActionOutputLabel", description = "@text/phonebookLookupActionOutputDescription", type = "java.lang.String") String phonebookLookup(
@ActionInput(name = "phonenumber", label = "@text/phonebookLookupActionInputPhoneNumberLabel", description = "@text/phonebookLookupActionInputPhoneNumberDescription", type = "java.lang.String", required = true) @Nullable String phonenumber,
@ActionInput(name = "matches", label = "@text/phonebookLookupActionInputMatchesLabel", description = "@text/phonebookLookupActionInputMatchesDescription", type = "java.lang.Integer") @Nullable Integer matchCount) {
return phonebookLookup(phonenumber, null, matchCount);
}

@RuleAction(label = "@text/phonebookLookupActionLabel", description = "@text/phonebookLookupActionDescription")
public @ActionOutput(name = "name", label = "@text/phonebookLookupActionOutputLabel", description = "@text/phonebookLookupActionOutputDescription", type = "java.lang.String") String phonebookLookup(
public @ActionOutput(label = "@text/phonebookLookupActionOutputLabel", description = "@text/phonebookLookupActionOutputDescription", type = "java.lang.String") String phonebookLookup(
@ActionInput(name = "phonenumber", label = "@text/phonebookLookupActionInputPhoneNumberLabel", description = "@text/phonebookLookupActionInputPhoneNumberDescription", type = "java.lang.String", required = true) @Nullable String phonenumber) {
return phonebookLookup(phonenumber, null, null);
}

@RuleAction(label = "@text/phonebookLookupActionLabel", description = "@text/phonebookLookupActionDescription")
public @ActionOutput(name = "name", label = "@text/phonebookLookupActionOutputLabel", description = "@text/phonebookLookupActionOutputDescription", type = "java.lang.String") String phonebookLookup(
public @ActionOutput(label = "@text/phonebookLookupActionOutputLabel", description = "@text/phonebookLookupActionOutputDescription", type = "java.lang.String") String phonebookLookup(
@ActionInput(name = "phonenumber", label = "@text/phonebookLookupActionInputPhoneNumberLabel", description = "@text/phonebookLookupActionInputPhoneNumberDescription", type = "java.lang.String", required = true) @Nullable String phonenumber,
@ActionInput(name = "phonebook", label = "@text/phonebookLookupActionInputPhoneBookLabel", description = "@text/phonebookLookupActionInputPhoneBookDescription", type = "java.lang.String") @Nullable String phonebook) {
return phonebookLookup(phonenumber, phonebook, null);
}

@RuleAction(label = "@text/phonebookLookupActionLabel", description = "@text/phonebookLookupActionDescription")
public @ActionOutput(name = "name", label = "@text/phonebookLookupActionOutputLabel", description = "@text/phonebookLookupActionOutputDescription", type = "java.lang.String") String phonebookLookup(
public @ActionOutput(label = "@text/phonebookLookupActionOutputLabel", description = "@text/phonebookLookupActionOutputDescription", type = "java.lang.String") String phonebookLookup(
@ActionInput(name = "phonenumber", label = "@text/phonebookLookupActionInputPhoneNumberLabel", description = "@text/phonebookLookupActionInputPhoneNumberDescription", type = "java.lang.String", required = true) @Nullable String phonenumber,
@ActionInput(name = "phonebook", label = "@text/phonebookLookupActionInputPhoneBookLabel", description = "@text/phonebookLookupActionInputPhoneBookDescription", type = "java.lang.String") @Nullable String phonebook,
@ActionInput(name = "matches", label = "@text/phonebookLookupActionInputMatchesLabel", description = "@text/phonebookLookupActionInputMatchesDescription", type = "java.lang.Integer") @Nullable Integer matchCount) {
Expand Down

0 comments on commit ebbe25e

Please sign in to comment.