|
|
@ -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); |
|
|
|
}); |
|
|
|