From d86edfe32b87588cec8a8f64635b124cf229cf17 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 17 Nov 2020 21:32:52 +0100 Subject: [PATCH] [miio] send miot actions parameter as jsonObject (#9056) * [miio] send miot actions parameter as jsonObject * [miio] avoid maven error Signed-off-by: Marcel Verpaalen --- .../binding/miio/internal/handler/MiIoBasicHandler.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoBasicHandler.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoBasicHandler.java index f8fadf3b56d..31b1d6b64ad 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoBasicHandler.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoBasicHandler.java @@ -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);