Commit 21d8acfb660149549073f8404a7460395323221b

Authored by 云中非
1 parent c84a5caa

fix: 场景联动动作支持自定义指令格式

@@ -155,12 +155,18 @@ public class JsonConverter { @@ -155,12 +155,18 @@ public class JsonConverter {
155 } 155 }
156 156
157 public static JsonElement toJson(TransportProtos.ToDeviceRpcRequestMsg msg, boolean includeRequestId) { 157 public static JsonElement toJson(TransportProtos.ToDeviceRpcRequestMsg msg, boolean includeRequestId) {
158 - JsonObject result = new JsonObject(); 158 + JsonObject result = null;
  159 + if("methodThingskit".equals(msg.getMethodName())){
  160 + result= JSON_PARSER.parse(msg.getParams()).getAsJsonObject();
  161 + }else{
  162 + result = new JsonObject();
  163 + result.addProperty("method", msg.getMethodName());
  164 + result.add("params", JSON_PARSER.parse(msg.getParams()));
  165 + }
159 if (includeRequestId) { 166 if (includeRequestId) {
160 result.addProperty("id", msg.getRequestId()); 167 result.addProperty("id", msg.getRequestId());
161 } 168 }
162 - result.addProperty("method", msg.getMethodName());  
163 - result.add("params", JSON_PARSER.parse(msg.getParams())); 169 +
164 return result; 170 return result;
165 } 171 }
166 172