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