Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 69e7893d27 | |||
| 30e530de6d |
@@ -167,6 +167,34 @@ func (d *Device) SaveUpgradeResult(upgradeTaskId uint32, status uint8, finishTim
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取语音助手参数列表
|
||||||
|
func (d *Device) GetVoiceAssistantList() ([]VoiceAssistant, error) {
|
||||||
|
body := map[string]any{}
|
||||||
|
result := &Result[[]VoiceAssistant]{}
|
||||||
|
if err := GetRequest().Send("device.get_voice_assistant_list", body, result); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if result.Code != 0 {
|
||||||
|
return nil, fmt.Errorf("%s", result.Message)
|
||||||
|
}
|
||||||
|
return result.Data, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取设备语音助手参数
|
||||||
|
func (d *Device) GetVoiceAssistant(deviceId uint32) (*VoiceAssistant, error) {
|
||||||
|
body := map[string]any{
|
||||||
|
"device_id": deviceId,
|
||||||
|
}
|
||||||
|
result := &Result[*VoiceAssistant]{}
|
||||||
|
if err := GetRequest().Send("device.get_voice_assistant", body, result); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if result.Code != 0 {
|
||||||
|
return nil, fmt.Errorf("%s", result.Message)
|
||||||
|
}
|
||||||
|
return result.Data, nil
|
||||||
|
}
|
||||||
|
|
||||||
var device *Device
|
var device *Device
|
||||||
|
|
||||||
// 获取设备相关RPC类
|
// 获取设备相关RPC类
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ func (r *Request) Send(methodName string, body any, responseBody any) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if r.logger != nil {
|
if r.logger != nil {
|
||||||
r.logger.Infof("method: %s, request: %s, response: %s",
|
r.logger.Debugf("method: %s, request: %s, response: %s",
|
||||||
methodName,
|
methodName,
|
||||||
string(bodyByte),
|
string(bodyByte),
|
||||||
string(responseBodyByte),
|
string(responseBodyByte),
|
||||||
|
|||||||
@@ -72,3 +72,11 @@ type WebsocketSignData struct {
|
|||||||
UserId uint32 `json:"user_id"`
|
UserId uint32 `json:"user_id"`
|
||||||
Platform string `json:"platform"`
|
Platform string `json:"platform"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 语音助手数据
|
||||||
|
type VoiceAssistant struct {
|
||||||
|
Id uint32 `json:"id"`
|
||||||
|
Type uint8 `json:"type"`
|
||||||
|
BemFaEnable uint8 `json:"bem_fa_enable"`
|
||||||
|
BemFaName string `json:"bem_fa_name"`
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user