Documentation
¶
Index ¶
- Constants
- func GetAndParseJSONResponseFromHttpResponse(resp *http.Response, result interface{}) error
- func GetBytesFromHttpResponse(resp *http.Response) ([]byte, error)
- type BlinkerDetailInfo
- type BlinkerDevice
- func (d *BlinkerDevice) AddVoiceAssistant(v *VoiceAssistant)
- func (d *BlinkerDevice) Init() error
- func (d *BlinkerDevice) Login() error
- func (d *BlinkerDevice) ReceiveMessageHandler(c MQTT.Client, m MQTT.Message)
- func (d *BlinkerDevice) RunHeartBearTimer()
- func (d *BlinkerDevice) RunSenderMessageService()
- func (d *BlinkerDevice) SendMessage(targetType, todevice, msgid string, msg any)
- func (d *BlinkerDevice) SyncAssistants() error
- type BlinkerInfoRes
- type VoiceAssistant
Constants ¶
View Source
const ( VA_TYPE_LIGHT = "light" VA_TYPE_OUTLET = "outlet" VA_TYPE_MULTI_OUTLET = "multi_outlet" VA_TYPE_SENSOR = "sensor" VA_TYPE_FAN = "fan" VA_TYPE_AIRCONDITION = "aircondition" )
View Source
const ( HOST = "https://iot.diandeng.tech" API_AUTH = HOST + "/api/v1/user/device/diy/auth" API_HEARTBEAT = HOST + "/api/v1/user/device/heartbeat" API_VOICE_ASSISTANT = HOST + "/api/v1/user/device/voice_assistant" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlinkerDetailInfo ¶
type BlinkerDevice ¶
type BlinkerDevice struct { DetailInfo BlinkerDetailInfo // contains filtered or unexported fields }
func CreateBlinkerDevice ¶
func CreateBlinkerDevice(ak string) *BlinkerDevice
func (*BlinkerDevice) AddVoiceAssistant ¶
func (d *BlinkerDevice) AddVoiceAssistant(v *VoiceAssistant)
func (*BlinkerDevice) Init ¶
func (d *BlinkerDevice) Init() error
func (*BlinkerDevice) Login ¶
func (d *BlinkerDevice) Login() error
func (*BlinkerDevice) ReceiveMessageHandler ¶
func (d *BlinkerDevice) ReceiveMessageHandler(c MQTT.Client, m MQTT.Message)
func (*BlinkerDevice) RunHeartBearTimer ¶
func (d *BlinkerDevice) RunHeartBearTimer()
func (*BlinkerDevice) RunSenderMessageService ¶
func (d *BlinkerDevice) RunSenderMessageService()
func (*BlinkerDevice) SendMessage ¶
func (d *BlinkerDevice) SendMessage(targetType, todevice, msgid string, msg any)
func (*BlinkerDevice) SyncAssistants ¶
func (d *BlinkerDevice) SyncAssistants() error
type BlinkerInfoRes ¶
type BlinkerInfoRes struct { Message int `json:"message"` Detail BlinkerDetailInfo `json:"detail"` }
type VoiceAssistant ¶
type VoiceAssistant struct { DeviceType string //语言助手类型 (设备类型). VAType string //语言助手类型 MIOT AliGenie DuerOS Device *BlinkerDevice // contains filtered or unexported fields }
func CreateVoiceAssistant ¶
func CreateVoiceAssistant(deviceType, vaType string) *VoiceAssistant
func (*VoiceAssistant) GetSKey ¶
func (v *VoiceAssistant) GetSKey() string
func (*VoiceAssistant) GetToDevice ¶
func (v *VoiceAssistant) GetToDevice() string
func (*VoiceAssistant) PowerChangeReply ¶
func (v *VoiceAssistant) PowerChangeReply(msgid, st string)
func (*VoiceAssistant) QueryDeviceState ¶
func (v *VoiceAssistant) QueryDeviceState(msgid string)
Click to show internal directories.
Click to hide internal directories.