diff --git a/pkg/rpc/device.go b/pkg/rpc/device.go index 6a3a212..095d2ff 100644 --- a/pkg/rpc/device.go +++ b/pkg/rpc/device.go @@ -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类 diff --git a/pkg/rpc/type.go b/pkg/rpc/type.go index ffabda4..f058ec8 100644 --- a/pkg/rpc/type.go +++ b/pkg/rpc/type.go @@ -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"` +}