添加语音助手相关方法

This commit is contained in:
2025-09-19 18:00:55 +08:00
parent 30e530de6d
commit e1c5ce2657
2 changed files with 36 additions and 0 deletions

View File

@@ -167,6 +167,34 @@ func (d *Device) SaveUpgradeResult(upgradeTaskId uint32, status uint8, finishTim
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
// 获取设备相关RPC类

View File

@@ -72,3 +72,11 @@ type WebsocketSignData struct {
UserId uint32 `json:"user_id"`
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"`
}