From 69e7893d274e2adc4d93f52ea3c4ed0bb1888a51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E6=81=92?= <2390904403@qq.com> Date: Fri, 19 Sep 2025 18:00:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AF=AD=E9=9F=B3=E5=8A=A9?= =?UTF-8?q?=E6=89=8B=E7=9B=B8=E5=85=B3=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/rpc/device.go | 28 ++++++++++++++++++++++++++++ pkg/rpc/type.go | 8 ++++++++ 2 files changed, 36 insertions(+) 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"` +}