Commit ca4eecca by 罗志长

fix: 读写属性回复

parent 551b0435
...@@ -253,11 +253,15 @@ public class JetLinksMqttDeviceMessageCodec implements DeviceMessageCodec { ...@@ -253,11 +253,15 @@ public class JetLinksMqttDeviceMessageCodec implements DeviceMessageCodec {
Set<String> keySet = jsonObject.keySet(); Set<String> keySet = jsonObject.keySet();
Map<String,Object> propertiesMap = new HashMap<>(); Map<String,Object> propertiesMap = new HashMap<>();
for (String key : keySet) { for (String key : keySet) {
Integer retCode = ((JSONObject) jsonObject.get(key)).getInteger("retCode");
Object value = ((JSONObject) jsonObject.get(key)).get("value"); Object value = ((JSONObject) jsonObject.get(key)).get("value");
if (value != null && value.toString().equals("success")) { propertiesMap.put(key, value);
propertiesMap.put(key, 0); if (message.getTopic().contains("write")) {
} else { if (retCode != null && retCode == 0) {
propertiesMap.put(key, value); if (value != null && value.toString().equals("success")) {
propertiesMap.put(key, 0);
}
}
} }
} }
map.put("properties", propertiesMap); map.put("properties", propertiesMap);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment