Browse Source

fix:加热之前,判断风扇状态,如果风扇运行中则关闭风扇

master
白凤吉 2 months ago
parent
commit
c5acc2e23b
  1. 4
      src/main/java/com/iflytop/gd/app/command/control/HeatStartCommand.java

4
src/main/java/com/iflytop/gd/app/command/control/HeatStartCommand.java

@ -44,6 +44,10 @@ public class HeatStartCommand extends BaseCommandHandler {
throw new AppException(ResultCode.CRAFT_RUNNING);
}
return runAsync(() -> {
if( deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).isFanOpen()){
heatModuleService.fanClose(heatModuleCode);//加热前尝试关闭风扇
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setFanOpen(false);
}
heatModuleService.heatRodOpen(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleCode, temperature);
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTargetTime(time);
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatTemperature(temperature);

Loading…
Cancel
Save