修改风扇
This commit is contained in:
parent
c1339fc599
commit
1d226cd89b
@ -201,6 +201,12 @@ public class TuyaDeviceService {
|
||||
List<JSONObject> collect = javaList.stream().filter(jl -> !ObjectUtils.isEmpty(jl.get("value")))
|
||||
.filter(jl -> !jl.getString("value").startsWith("{"))
|
||||
.filter(jl -> !jl.getString("value").startsWith("[")).collect(Collectors.toList());
|
||||
if (Objects.equals(deviceInfo.getString("category"), "fs")) {
|
||||
JSONObject fsJson = new JSONObject();
|
||||
fsJson.put("code", "switch");
|
||||
fsJson.put("value", true);
|
||||
collect.add(fsJson);
|
||||
}
|
||||
commands.put("commands", categoryBoolean ? Arrays.asList(jsonObject) : collect);
|
||||
Boolean result = tuyaDeviceConnector.controlDevice(query.getDeviceId(), commands);
|
||||
if (result) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user