Skip to content

Commit

Permalink
pr review: remove useless check
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Álvarez Díez <miguelwork92@gmail.com>
  • Loading branch information
GiviMAD committed Dec 17, 2021
1 parent 8af8619 commit de006ff
Showing 1 changed file with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit de006ff

Please sign in to comment.