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

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

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
Marcel 2020-11-18 23:40:42 +01:00 committed by GitHub
parent be5c4b9d24
commit 19ae11dcb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -200,7 +200,13 @@ public class MiIoBasicHandler extends MiIoAbstractHandler {
parameters.add(value);
}
}
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);