[yioremote] Update ir code macth pattern (#9169)

Signed-off-by: Michael Loercher <michaelloercher@web.de>
pull/8844/head
miloit 2020-12-01 01:55:55 +01:00 committed by GitHub
parent 1abe9da2d4
commit 27f280cfa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -194,7 +194,7 @@ public class YIOremoteDockHandler extends BaseThingHandler {
}
} else if (message.get("command").toString().equalsIgnoreCase("\"ir_receive\"")) {
receivedStatus = message.get("code").toString().replace("\"", "");
if (receivedStatus.matches("[0-9][;]0[xX][0-9a-fA-F]+[;][0-9]+[;][0-9]")) {
if (receivedStatus.matches("[0-9]?[0-9][;]0[xX][0-9a-fA-F]+[;][0-9]+[;][0-9]")) {
irCodeReceivedHandler.setCode(message.get("code").toString().replace("\"", ""));
} else {
irCodeReceivedHandler.setCode("");
@ -281,7 +281,7 @@ public class YIOremoteDockHandler extends BaseThingHandler {
public void sendIRCode(@Nullable String irCode) {
if (irCode != null && yioRemoteDockActualStatus.equals(YioRemoteDockHandleStatus.AUTHENTICATION_COMPLETE)) {
if (irCode.matches("[0-9][;]0[xX][0-9a-fA-F]+[;][0-9]+[;][0-9]")) {
if (irCode.matches("[0-9]?[0-9][;]0[xX][0-9a-fA-F]+[;][0-9]+[;][0-9]")) {
sendMessage(YioRemoteMessages.IR_SEND, irCode);
} else {
logger.warn("Wrong ir code format {}", irCode);