[knx] Bugfix problem with DPT 251.600 (#15723)

* Fix problem with DPT 251.600.
In the old implementation the datatype was implemented with byte 0-255.
The DPT 251.600 is defined with 0-100%, change this from byte to
PercentType.

Signed-off-by: Marco Mueller <marco@ms.mueller.ch>
This commit is contained in:
Marco Müller 2023-10-10 09:58:49 +02:00 committed by GitHub
parent 0c3ef0a5f4
commit 06d8e750f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -162,8 +162,9 @@ public class ValueEncoder {
double[] xyY = ColorUtil.hsbToXY(hsb);
return String.format("(%,.4f %,.4f) %,.1f %%", xyY[0], xyY[1], xyY[2] * 100.0);
case "251.600":
rgb = ColorUtil.hsbToRgb(hsb);
return String.format("%d %d %d - %%", rgb[0], rgb[1], rgb[2]);
PercentType[] rgbw = ColorUtil.hsbToRgbPercent(hsb);
return String.format("%,.1f %,.1f %,.1f - %%", rgbw[0].doubleValue(), rgbw[1].doubleValue(),
rgbw[2].doubleValue());
case "5.003":
return hsb.getHue().toString();
default: