Merge branch 'feature-BOX一期' of http://47.99.132.106:10081/wulin/qiuguo-iot into feature-BOX一期

This commit is contained in:
wulin 2023-09-25 19:58:54 +08:00
commit 8b35c9b3f3

View File

@ -61,7 +61,7 @@ public class TuyaDeviceService {
}
JSONObject deviceInfo = jsonArray.getJSONObject(0);
if (Objects.equals(deviceInfo.getBoolean("is_online"), false) && !Objects.equals(data.getMatchingFields(),
"")) {
"")) {
return Mono.just(false);
}
JSONObject commands = new JSONObject();
@ -69,7 +69,7 @@ public class TuyaDeviceService {
String type = data.getType();
jsonObject.put("code", data.getCode());
if (type.equalsIgnoreCase("boolean")) {
jsonObject.put("value", data.getValue());
jsonObject.put("value", Boolean.parseBoolean(data.getValue()));
} else if (type.equalsIgnoreCase("Integer")) {
jsonObject.put("value", Integer.parseInt(data.getValue()));
} else if (type.equalsIgnoreCase("Enum")) {