Skip to content

Commit

Permalink
[smsmodem] Small fixes
Browse files Browse the repository at this point in the history
update channel
rename action to avoid colision with other binding and a too generic name

Signed-off-by: Gwendal Roulleau <[email protected]>
  • Loading branch information
dalgwen committed Mar 7, 2022
1 parent 87c12f9 commit 82f91c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void setThingHandler(@Nullable ThingHandler handler) {
}

@RuleAction(label = "Send Message", description = "Send a message")
public void send(
public void sendSMS(
@ActionInput(name = "recipient", label = "recipient", description = "Recipient of the message") @Nullable String recipient,
@ActionInput(name = "message", label = "message", description = "Message to send") @Nullable String message) {
if (recipient != null && !recipient.isEmpty() && message != null) {
Expand All @@ -57,9 +57,9 @@ public void send(
}
}

public static void send(@Nullable ThingActions actions, @Nullable String recipient, @Nullable String message) {
public static void sendSMS(@Nullable ThingActions actions, @Nullable String recipient, @Nullable String message) {
if (actions instanceof SMSModemActions) {
((SMSModemActions) actions).send(recipient, message);
((SMSModemActions) actions).sendSMS(recipient, message);
} else {
throw new IllegalArgumentException("Instance is not an SMSModemActions class.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public void handleCommand(ChannelUID channelUID, Command command) {
}
if (channelUID.getId().equals(SMSModemBindingConstants.CHANNEL_SEND)) {
send(command.toString());
updateState(SMSModemBindingConstants.CHANNEL_SEND, new StringType(command.toString()));
}
}

Expand Down

0 comments on commit 82f91c8

Please sign in to comment.