upnp: ignore negative volume values

Signed-off-by: Stefan Höhn <stefan.hoehn@nfon.com>
This commit is contained in:
Stefan Höhn 2024-12-28 11:02:30 +01:00
parent d14749bb64
commit 20155f0cf1

View File

@ -1113,6 +1113,11 @@ public class UpnpRendererHandler extends UpnpHandler {
long volume = Long.valueOf(value);
volume = volume * 100 / config.maxvolume;
if (volume < 0) {
logger.warn("UPnP device {} received invalid volume value {}", thing.getLabel(), value);
return;
}
String upnpChannel = variable.replace("Volume", "volume").replace("Master", "");
updateState(upnpChannel, new PercentType((int) volume));