Skip to content

Commit

Permalink
[heos] Fix runtime error; Support for new Denon "Home" speaker added (o…
Browse files Browse the repository at this point in the history
…penhab#9935)

* Support for Denon "Home" speaker as bridge added
* Fixed a runtime issue if no serial number is provided by the player, by using the PID as a fallback if no serial number is available

Signed-off-by: Wire82 <[email protected]>
  • Loading branch information
Wire82 authored Jan 28, 2021
1 parent 6473935 commit 2127ac2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ private String getModel(ModelDetails modelDetails) {
DeviceDetails details = device.getDetails();
String modelName = details.getModelDetails().getModelName();
String modelManufacturer = details.getManufacturerDetails().getManufacturer();
if ("Denon".equals(modelManufacturer) && (modelName.startsWith("HEOS") || modelName.endsWith("H"))) {
if ("Denon".equals(modelManufacturer)
&& (modelName.startsWith("HEOS") || modelName.endsWith("H") || modelName.contains("Home"))) {
String deviceType = device.getType().getType();
if (deviceType.startsWith("ACT") || deviceType.startsWith("Aios")) {
return new ThingUID(THING_TYPE_BRIDGE, device.getIdentity().getUdn().getIdentifierString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ public static void propertiesFromPlayer(Map<String, ? super String> prop, Player
String serialNumber = player.serial;
if (serialNumber != null) {
prop.put(Thing.PROPERTY_SERIAL_NUMBER, serialNumber);
} else {
prop.put(Thing.PROPERTY_SERIAL_NUMBER, String.valueOf(player.playerId)); // If no serial number is provided,
// write an empty string to
// prevent error during runtime
}
}
}

0 comments on commit 2127ac2

Please sign in to comment.