Browse Source

调整调试指令

master
白凤吉 2 months ago
parent
commit
2948c05007
  1. 14
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugFanStartCommand.java

14
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugFanStartCommand.java

@ -30,14 +30,12 @@ public class DebugFanStartCommand extends BaseCommandHandler {
String heatModuleCodeStr = cmdDTO.getStringParam("heatModuleCode");
HeatModuleCode heatModuleCode = HeatModuleCode.valueOf(heatModuleCodeStr);
return runAsync(() -> {
DeviceCommandBundle deviceCommand;
switch (heatModuleCode) {
case heat_module_01 -> deviceCommand = DeviceCommandGenerator.fan1Open();
case heat_module_02 -> deviceCommand = DeviceCommandGenerator.fan2Open();
case heat_module_03 -> deviceCommand = DeviceCommandGenerator.fan3Open();
case heat_module_04 -> deviceCommand = DeviceCommandGenerator.fan4Open();
default -> throw new RuntimeException("heatModuleCode 未找到");
}
DeviceCommandBundle deviceCommand = switch (heatModuleCode) {
case heat_module_01 -> DeviceCommandGenerator.fan1Open();
case heat_module_02 -> DeviceCommandGenerator.fan2Open();
case heat_module_03 -> DeviceCommandGenerator.fan3Open();
case heat_module_04 -> DeviceCommandGenerator.fan4Open();
};
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);
CommandUtil.wait(deviceCommandFuture);
});

Loading…
Cancel
Save