[mqtt] Fix deprecations in color conversion code (#20867)

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
Holger Friedrich
2026-06-03 21:32:31 +02:00
committed by GitHub
parent 3b2048ae1d
commit df5e9dd4db
@@ -110,7 +110,8 @@ public class ColorValue extends Value {
return HSBType.fromRGB(Integer.parseInt(split[0]), Integer.parseInt(split[1]),
Integer.parseInt(split[2]));
case XYY:
HSBType tempState = HSBType.fromXY(Float.parseFloat(split[0]), Float.parseFloat(split[1]));
HSBType tempState = ColorUtil
.xyToHsb(new double[] { Double.parseDouble(split[0]), Double.parseDouble(split[1]) });
return new HSBType(tempState.getHue(), tempState.getSaturation(), new PercentType(split[2]));
default:
throw new IllegalArgumentException("Non supported color mode");