mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-29 12:34:21 +02:00
[wifiled] Deprecations (#20843)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
+5
-3
@@ -16,6 +16,7 @@ import static java.lang.Math.max;
|
||||
|
||||
import org.openhab.core.library.types.HSBType;
|
||||
import org.openhab.core.library.types.PercentType;
|
||||
import org.openhab.core.util.ColorUtil;
|
||||
|
||||
/**
|
||||
* Internal LED state.
|
||||
@@ -46,11 +47,12 @@ public class InternalLedState {
|
||||
}
|
||||
|
||||
public InternalLedState withColor(HSBType color) {
|
||||
PercentType[] rgb = ColorUtil.hsbToRgbPercent(color);
|
||||
//@formatter:off
|
||||
return new InternalLedState(
|
||||
color.getRed().doubleValue() / 100,
|
||||
color.getGreen().doubleValue() / 100,
|
||||
color.getBlue().doubleValue() / 100,
|
||||
rgb[0].doubleValue() / 100,
|
||||
rgb[1].doubleValue() / 100,
|
||||
rgb[2].doubleValue() / 100,
|
||||
w,
|
||||
w2
|
||||
);
|
||||
|
||||
+2
-1
@@ -23,6 +23,7 @@ import org.openhab.core.library.types.HSBType;
|
||||
import org.openhab.core.library.types.OnOffType;
|
||||
import org.openhab.core.library.types.PercentType;
|
||||
import org.openhab.core.library.types.StringType;
|
||||
import org.openhab.core.util.ColorUtil;
|
||||
|
||||
/**
|
||||
* The {@link LEDStateDTO} class holds the data and the settings for a LED device (i.e. the selected colors, the running
|
||||
@@ -171,7 +172,7 @@ public class LEDStateDTO {
|
||||
}
|
||||
|
||||
public int getRGB() {
|
||||
return hsbType.getRGB();
|
||||
return ColorUtil.hsbTosRgb(hsbType);
|
||||
}
|
||||
|
||||
public HSBType getHSB() {
|
||||
|
||||
Reference in New Issue
Block a user