Skip to content

Commit

Permalink
[miio] send miot actions parameter as jsonObject (openhab#9056)
Browse files Browse the repository at this point in the history
* [miio] send miot actions parameter as jsonObject
* [miio] avoid maven error

Signed-off-by: Marcel Verpaalen <[email protected]>
  • Loading branch information
marcelrv authored Nov 17, 2020
1 parent 754daa0 commit d86edfe
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,13 @@ public void handleCommand(ChannelUID channelUID, Command receivedCommand) {
parameters.add(value);
}
}
cmd = cmd + parameters.toString();
if (action.isMiOtAction() && parameters.size() > 0 && parameters.get(0).isJsonObject()) {
// hack as unlike any other commands miot actions parameters appear to be send as a json object
// instead of a json array
cmd = cmd + parameters.get(0).getAsJsonObject().toString();
} else {
cmd = cmd + parameters.toString();
}
if (value != null) {
logger.debug("Sending command {}", cmd);
sendCommand(cmd);
Expand Down

0 comments on commit d86edfe

Please sign in to comment.