}
break;
case CHANNEL_VOLUMEDB:
- setVolumeDb(((QuantityType<?>) command).floatValue(), zone, this.host);
+ float volumeDb;
+ if (command instanceof QuantityType<?> qt) {
+ volumeDb = qt.toUnit(Units.DECIBEL).floatValue();
+ } else if (command instanceof DecimalType dt) {
+ volumeDb = dt.floatValue();
+ } else {
+ logger.debug("Command has wrong type, QuantityType or DecimalType required!");
+ return;
+ }
+ setVolumeDb(volumeDb, zone, this.host);
localSyncVolume = Boolean.parseBoolean(getThing().getConfiguration().get("syncVolume").toString());
if (localSyncVolume == Boolean.TRUE) {
tmpString = getDistributionInfo(this.host);
if ("server".equals(localRole)) {
for (JsonElement ip : distributioninfo.getClientList()) {
JsonObject clientObject = ip.getAsJsonObject();
- setVolumeDbLinkedDevice(((DecimalType) command).floatValue(), zone,
+ setVolumeDbLinkedDevice(volumeDb, zone,
clientObject.get("ip_address").getAsString());
}
}