From 2948c0500766f749e11efe3922e529853db20a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=87=A4=E5=90=89?= Date: Mon, 26 May 2025 11:46:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B0=83=E8=AF=95=E6=8C=87?= =?UTF-8?q?=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iflytop/sgs/app/cmd/debug/DebugFanStartCommand.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugFanStartCommand.java b/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugFanStartCommand.java index 10a369d..8651cce 100644 --- a/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugFanStartCommand.java +++ b/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); });