mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-27 07:41:39 +01:00
[miio] onoffpara commandtype fix (#8675)
Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
parent
7615e5fd09
commit
43be10c204
@ -152,6 +152,7 @@ public class MiIoBasicHandler extends MiIoAbstractHandler {
|
|||||||
value = new JsonPrimitive(command == OnOffType.ON ? "on" : "off");
|
value = new JsonPrimitive(command == OnOffType.ON ? "on" : "off");
|
||||||
} else if (paramType == CommandParameterType.ONOFFPARA) {
|
} else if (paramType == CommandParameterType.ONOFFPARA) {
|
||||||
cmd = cmd.replace("*", command == OnOffType.ON ? "on" : "off");
|
cmd = cmd.replace("*", command == OnOffType.ON ? "on" : "off");
|
||||||
|
value = new JsonArray();
|
||||||
} else if (paramType == CommandParameterType.ONOFFBOOL) {
|
} else if (paramType == CommandParameterType.ONOFFBOOL) {
|
||||||
boolean boolCommand = command == OnOffType.ON;
|
boolean boolCommand = command == OnOffType.ON;
|
||||||
value = new JsonPrimitive(boolCommand);
|
value = new JsonPrimitive(boolCommand);
|
||||||
@ -186,7 +187,8 @@ public class MiIoBasicHandler extends MiIoAbstractHandler {
|
|||||||
value = miotTransform(miIoBasicChannel, value);
|
value = miotTransform(miIoBasicChannel, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (paramType != CommandParameterType.NONE && value != null) {
|
if (paramType != CommandParameterType.NONE && paramType != CommandParameterType.ONOFFPARA
|
||||||
|
&& value != null) {
|
||||||
if (parameters.size() > 0) {
|
if (parameters.size() > 0) {
|
||||||
parameters.set(valuePos, value);
|
parameters.set(valuePos, value);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user