[miio] onoffpara commandtype fix (#8675)

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
Marcel 2020-10-06 21:45:10 +02:00 committed by GitHub
parent 7615e5fd09
commit 43be10c204
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {