mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[miio] fix color lights sending numbers as strings (#10960)
* [miio] fix color lights sending numbers as strings Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
parent
29acaf6246
commit
c0ab022e4e
@ -598,7 +598,8 @@ public class MiIoBasicHandler extends MiIoAbstractHandler {
|
||||
}
|
||||
break;
|
||||
case "color":
|
||||
if (val.isJsonPrimitive() && val.getAsJsonPrimitive().isNumber()) {
|
||||
if (val.isJsonPrimitive()
|
||||
&& (val.getAsJsonPrimitive().isNumber() || val.getAsString().matches("^[0-9]+$"))) {
|
||||
Color rgb = new Color(val.getAsInt());
|
||||
HSBType hsb = HSBType.fromRGB(rgb.getRed(), rgb.getGreen(), rgb.getBlue());
|
||||
updateState(basicChannel.getChannel(), hsb);
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user