[miio] send miot actions parameter as jsonObject (#9056)

* [miio] send miot actions parameter as jsonObject
* [miio] avoid maven error

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
pull/9072/head
Marcel 2020-11-17 21:32:52 +01:00 committed by GitHub
parent 754daa0140
commit d86edfe32b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -227,7 +227,13 @@ public class MiIoBasicHandler extends MiIoAbstractHandler {
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);