[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…
x
Reference in New Issue
Block a user