修改开关
This commit is contained in:
parent
7a18f92d6e
commit
2f015efa83
@ -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")) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user