修改开关

This commit is contained in:
weiyachao 2023-09-25 18:02:25 +08:00
parent 7a18f92d6e
commit 2f015efa83

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")) {