Skip to content

Commit

Permalink
[oppo] rollforward a few review changes from sister bindings and fix …
Browse files Browse the repository at this point in the history
…a title (openhab#8335)

* Rollforward a few review changes
* fix thread naming convention

Signed-off-by: Michael Lobstein <[email protected]>
  • Loading branch information
mlobstein authored and CSchlipp committed Sep 12, 2020
1 parent 2b9f805 commit 4d74b41
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<features name="org.openhab.binding.oppo-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>

<feature name="openhab-binding-oppo" description="Oppo Whole House Audio Binding" version="${project.version}">
<feature name="openhab-binding-oppo" description="Oppo Blu-ray Player Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<feature>openhab-transport-serial</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.oppo/${project.version}</bundle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public enum OppoCommand {
SET_INPUT_SOURCE("SIS"),
NO_OP("NOP");

private String value;
private final String value;

public static final Set<OppoCommand> INITIAL_COMMANDS = new HashSet<>(
Arrays.asList(QUERY_POWER_STATUS, QUERY_FIRMWARE_VERSION, QUERY_VOLUME, QUERY_HDMI_RESOLUTION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public abstract class OppoConnector {

private @Nullable Thread readerThread;

private List<OppoMessageEventListener> listeners = new ArrayList<>();
private final List<OppoMessageEventListener> listeners = new ArrayList<>();

/**
* Called when using direct IP connection for 83/93/95/103/105
Expand Down Expand Up @@ -135,12 +135,12 @@ protected void cleanup() {
}
if (readerThread != null) {
readerThread.interrupt();
this.readerThread = null;
try {
readerThread.join(3000);
} catch (InterruptedException e) {
logger.warn("Error joining readerThread: {}", e.getMessage());
}
this.readerThread = null;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
public class OppoIpConnector extends OppoConnector {
private final Logger logger = LoggerFactory.getLogger(OppoIpConnector.class);

private @Nullable String address;
private int port;
private final @Nullable String address;
private final int port;

private @Nullable Socket clientSocket;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
public class OppoMessageEvent extends EventObject {

private static final long serialVersionUID = 1L;
private String key;
private String value;
private final String key;
private final String value;

public OppoMessageEvent(Object source, String key, String value) {
super(source);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ public class OppoReaderThread extends Thread {
* Constructor
*
* @param connector the object that should handle the received message
* @param connectionId a string that uniquely identifies the particular connection
*/
public OppoReaderThread(OppoConnector connector, String uid) {
super(OppoBindingConstants.BINDING_ID + "-" + uid);
public OppoReaderThread(OppoConnector connector, String connectionId) {
super("OH-binding-" + OppoBindingConstants.THING_TYPE_PLAYER + "-" + connectionId);
this.connector = connector;
setDaemon(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
public class OppoSerialConnector extends OppoConnector {
private final Logger logger = LoggerFactory.getLogger(OppoSerialConnector.class);

private String serialPortName;
private SerialPortManager serialPortManager;
private final String serialPortName;
private final SerialPortManager serialPortManager;

private @Nullable SerialPort serialPort;

Expand Down

0 comments on commit 4d74b41

Please sign in to comment.