Skip to content

Commit e0fd389

Browse files
committed
review changes
Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
1 parent 9620ac2 commit e0fd389

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

bundles/org.openhab.binding.oppo/src/main/java/org/openhab/binding/oppo/internal/discovery/OppoDiscoveryService.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ protected void startScan() {
150150
try {
151151
multiSocket.receive(packet);
152152

153-
final String message = new String(packet.getData(), StandardCharsets.US_ASCII).trim();
153+
final String message = new String(packet.getData(), 0, packet.getLength(),
154+
StandardCharsets.US_ASCII).trim();
154155
if (message.length() > 0) {
155156
messageReceive(message);
156157
}
@@ -195,7 +196,7 @@ private void messageReceive(String message) {
195196
String displayName = null;
196197

197198
for (final String msg : message.split("\n")) {
198-
final String[] line = msg.split(":");
199+
final String[] line = msg.split(":", 2);
199200

200201
if (line.length == 2) {
201202
if (line[0].contains("Server IP")) {
@@ -225,7 +226,7 @@ private void messageReceive(String message) {
225226
// The older models do not have the "Server Name" in the discovery packet
226227
// for the 10x we need to get the DLNA service list page and find modelNumber there
227228
// in order to determine if this is a BDP-103 or BDP-105
228-
// It is not known if the BDP-9x has this page so a failure to will default to THING_TYPE_BDP93
229+
// It is not known if the BDP-9x has this page so a failure will default to THING_TYPE_BDP93
229230
try {
230231
final String result = HttpUtil.executeUrl("GET", "http://" + host + ":2870/dmr.xml", 5000);
231232

bundles/org.openhab.binding.oppo/src/main/java/org/openhab/binding/oppo/internal/handler/OppoHandler.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void initialize() {
146146
}
147147
model = config.model;
148148
} else {
149-
model = Integer.parseInt(thing.getThingTypeUID().getAsString().replaceAll("[^\\d.]", ""));
149+
model = Integer.parseInt(thing.getThingTypeUID().getId().replaceAll("\\D", ""));
150150
}
151151
this.isUDP20X = (model == MODEL203 || model == MODEL205);
152152

@@ -1037,10 +1037,10 @@ private void buildStateOptionLists(int model) {
10371037

10381038
if (model == MODEL103 || model == MODEL105) {
10391039
inputSourceOptions.add(new StateOption("0", getString("blu_ray", "Blu-ray Player")));
1040-
inputSourceOptions.add(new StateOption("1", getString("hdmi_in_front", "HDMI/MHL In-Front")));
1040+
inputSourceOptions.add(new StateOption("1", getString("hdmi_in_front", "HDMI In-Front")));
10411041
inputSourceOptions.add(new StateOption("2", getString("hdmi_in_back", "HDMI In-Back")));
1042-
inputSourceOptions.add(new StateOption("3", getString("arc1", "ARC on HDMI Out 1")));
1043-
inputSourceOptions.add(new StateOption("4", getString("arc2", "ARC on HDMI Out 2")));
1042+
inputSourceOptions.add(new StateOption("3", getString("arc1", "ARC HDMI Out 1")));
1043+
inputSourceOptions.add(new StateOption("4", getString("arc2", "ARC HDMI Out 2")));
10441044

10451045
if (model == MODEL105) {
10461046
inputSourceOptions.add(new StateOption("5", getString("optical", "Optical In")));
@@ -1071,7 +1071,7 @@ private void buildStateOptionLists(int model) {
10711071

10721072
inputSourceOptions.add(new StateOption("0", getString("blu_ray", "Blu-ray Player")));
10731073
inputSourceOptions.add(new StateOption("1", getString("hdmi_in", "HDMI In")));
1074-
inputSourceOptions.add(new StateOption("2", getString("arc", "ARC")));
1074+
inputSourceOptions.add(new StateOption("2", getString("arc", "ARC HDMI Out")));
10751075

10761076
if (model == MODEL205) {
10771077
inputSourceOptions.add(new StateOption("3", getString("optical", "Optical In")));

bundles/org.openhab.binding.oppo/src/main/resources/OH-INF/config/config.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
</parameter>
2525
<parameter name="verboseMode" type="boolean" required="false">
2626
<label>Verbose Mode</label>
27-
<description>If true, the player will send time updates every second. If false, the binding polls the player every
28-
10
27+
<description>If true, the player will send time updates every second. If false, the binding polls the player every 10
2928
seconds</description>
3029
<default>false</default>
3130
<advanced>true</advanced>

bundles/org.openhab.binding.oppo/src/main/resources/OH-INF/i18n/oppo.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,9 @@ channel-type.oppo.zoom_mode.state.option.12 = 1/4
425425

426426
# selectable player option descriptions
427427

428-
option.arc = ARC
429-
option.arc1 = ARC on HDMI Out 1
430-
option.arc2 = ARC on HDMI Out 2
428+
option.arc = ARC HDMI Out
429+
option.arc1 = ARC HDMI Out 1
430+
option.arc2 = ARC HDMI Out 2
431431
option.auto = Auto
432432
option.auto_1080p = 1080P Auto
433433
option.auto_uhd = UHD Auto
@@ -436,7 +436,7 @@ option.coaxial = Coaxial In
436436
option.direct = Source Direct
437437
option.hdmi_in = HDMI In
438438
option.hdmi_in_back = HDMI In-Back
439-
option.hdmi_in_front = HDMI/MHL In-Front
439+
option.hdmi_in_front = HDMI In-Front
440440
option.optical = Optical In
441441
option.usb = USB Audio In
442442

0 commit comments

Comments
 (0)