mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 23:22:02 +01:00
[heos] Fix runtime error; Support for new Denon "Home" speaker added (#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 <johannes.einig@me.com>
This commit is contained in:
parent
6473935482
commit
2127ac23c8
@ -79,7 +79,8 @@ public class HeosDiscoveryParticipant implements UpnpDiscoveryParticipant {
|
|||||||
DeviceDetails details = device.getDetails();
|
DeviceDetails details = device.getDetails();
|
||||||
String modelName = details.getModelDetails().getModelName();
|
String modelName = details.getModelDetails().getModelName();
|
||||||
String modelManufacturer = details.getManufacturerDetails().getManufacturer();
|
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();
|
String deviceType = device.getType().getType();
|
||||||
if (deviceType.startsWith("ACT") || deviceType.startsWith("Aios")) {
|
if (deviceType.startsWith("ACT") || deviceType.startsWith("Aios")) {
|
||||||
return new ThingUID(THING_TYPE_BRIDGE, device.getIdentity().getUdn().getIdentifierString());
|
return new ThingUID(THING_TYPE_BRIDGE, device.getIdentity().getUdn().getIdentifierString());
|
||||||
|
@ -179,6 +179,10 @@ public class HeosPlayerHandler extends HeosThingBaseHandler {
|
|||||||
String serialNumber = player.serial;
|
String serialNumber = player.serial;
|
||||||
if (serialNumber != null) {
|
if (serialNumber != null) {
|
||||||
prop.put(Thing.PROPERTY_SERIAL_NUMBER, serialNumber);
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user