[miio] onoffpara commandtype fix (#8675)
Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>pull/8681/head
parent
7615e5fd09
commit
43be10c204
bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler
|
@ -152,6 +152,7 @@ public class MiIoBasicHandler extends MiIoAbstractHandler {
|
|||
value = new JsonPrimitive(command == OnOffType.ON ? "on" : "off");
|
||||
} else if (paramType == CommandParameterType.ONOFFPARA) {
|
||||
cmd = cmd.replace("*", command == OnOffType.ON ? "on" : "off");
|
||||
value = new JsonArray();
|
||||
} else if (paramType == CommandParameterType.ONOFFBOOL) {
|
||||
boolean boolCommand = command == OnOffType.ON;
|
||||
value = new JsonPrimitive(boolCommand);
|
||||
|
@ -186,7 +187,8 @@ public class MiIoBasicHandler extends MiIoAbstractHandler {
|
|||
value = miotTransform(miIoBasicChannel, value);
|
||||
}
|
||||
}
|
||||
if (paramType != CommandParameterType.NONE && value != null) {
|
||||
if (paramType != CommandParameterType.NONE && paramType != CommandParameterType.ONOFFPARA
|
||||
&& value != null) {
|
||||
if (parameters.size() > 0) {
|
||||
parameters.set(valuePos, value);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue