白凤吉 2 months ago
parent
commit
2e926d9ea9
  1. 26
      src/main/java/com/iflytop/sgs/app/service/device/DeviceLightSoundService.java

26
src/main/java/com/iflytop/sgs/app/service/device/DeviceLightSoundService.java

@ -0,0 +1,26 @@
package com.iflytop.sgs.app.service.device;
import com.iflytop.sgs.common.cmd.DeviceCommandBundle;
import com.iflytop.sgs.common.cmd.DeviceCommandGenerator;
import com.iflytop.sgs.common.enums.cmd.CmdColor;
import com.iflytop.sgs.hardware.exception.HardwareException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service
@RequiredArgsConstructor
public class DeviceLightSoundService {
private final DeviceCommandService deviceCommandService;
/*
* 获取传感器状态
* */
public void openColor(CmdColor color) throws HardwareException {
DeviceCommandBundle deviceCommandBundle=DeviceCommandGenerator.tricolorLightOpen(color);
deviceCommandService.sendCommand(deviceCommandBundle);
}
}
Loading…
Cancel
Save