Skip to content

Commit

Permalink
[knx] Bugfix problem with DPT 251.600 (openhab#15723)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
genesis81 authored and pat-git023 committed Oct 13, 2023
1 parent f43d764 commit 4af6830
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,9 @@ private static String handleHSBType(String dptId, HSBType hsb) {
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:
Expand Down

0 comments on commit 4af6830

Please sign in to comment.