修改风扇

This commit is contained in:
weiyachao 2023-10-09 15:26:28 +08:00
parent c1339fc599
commit 1d226cd89b

View File

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