[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:
parent
0c3ef0a5f4
commit
06d8e750f2
|
@ -162,8 +162,9 @@ public class ValueEncoder {
|
||||||
double[] xyY = ColorUtil.hsbToXY(hsb);
|
double[] xyY = ColorUtil.hsbToXY(hsb);
|
||||||
return String.format("(%,.4f %,.4f) %,.1f %%", xyY[0], xyY[1], xyY[2] * 100.0);
|
return String.format("(%,.4f %,.4f) %,.1f %%", xyY[0], xyY[1], xyY[2] * 100.0);
|
||||||
case "251.600":
|
case "251.600":
|
||||||
rgb = ColorUtil.hsbToRgb(hsb);
|
PercentType[] rgbw = ColorUtil.hsbToRgbPercent(hsb);
|
||||||
return String.format("%d %d %d - %%", rgb[0], rgb[1], rgb[2]);
|
return String.format("%,.1f %,.1f %,.1f - %%", rgbw[0].doubleValue(), rgbw[1].doubleValue(),
|
||||||
|
rgbw[2].doubleValue());
|
||||||
case "5.003":
|
case "5.003":
|
||||||
return hsb.getHue().toString();
|
return hsb.getHue().toString();
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue