From de006ff4b661e28b377db40f9361d025b0985b93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81lvarez=20D=C3=ADez?= Date: Fri, 17 Dec 2021 21:06:40 +0100 Subject: [PATCH] pr review: remove useless check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miguel Álvarez Díez --- .../internal/AndroidDebugBridgeHandler.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/bundles/org.openhab.binding.androiddebugbridge/src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeHandler.java b/bundles/org.openhab.binding.androiddebugbridge/src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeHandler.java index 88dc970355545..14dea1ada80b5 100644 --- a/bundles/org.openhab.binding.androiddebugbridge/src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeHandler.java +++ b/bundles/org.openhab.binding.androiddebugbridge/src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeHandler.java @@ -198,19 +198,17 @@ private void recordDeviceInput(Command recordNameCommand) } String recordPropertyName = getRecordPropertyName(recordName); logger.debug("RECORD: {}", recordPropertyName); - if (!recordPropertyName.isEmpty() && !recordPropertyName.equals("NULL")) { - var eventCommand = adbConnection.recordInputEvents(); - if (eventCommand.isEmpty()) { - logger.debug("No events recorded"); - if (this.getThing().getProperties().containsKey(recordPropertyName)) { - this.getThing().setProperty(recordPropertyName, null); - updateProperties(editProperties()); - logger.debug("Record {} deleted", recordName); - } - } else { - updateProperty(recordPropertyName, eventCommand); - logger.debug("New record {}: {}", recordName, eventCommand); + var eventCommand = adbConnection.recordInputEvents(); + if (eventCommand.isEmpty()) { + logger.debug("No events recorded"); + if (this.getThing().getProperties().containsKey(recordPropertyName)) { + this.getThing().setProperty(recordPropertyName, null); + updateProperties(editProperties()); + logger.debug("Record {} deleted", recordName); } + } else { + updateProperty(recordPropertyName, eventCommand); + logger.debug("New record {}: {}", recordName, eventCommand); } }