修改设备参数返回值

This commit is contained in:
2025-10-17 17:31:52 +08:00
parent df5fb556a0
commit a05373e50c

View File

@@ -120,7 +120,7 @@ func (d *Device) SetAttribute(deviceId uint32, attributeSet map[string]any) erro
} }
// 获取设备属性 // 获取设备属性
func (d *Device) GetAttribute(deviceId uint32) (*map[string]any, error) { func (d *Device) GetAttribute(deviceId uint32) (map[string]any, error) {
body := map[string]any{ body := map[string]any{
"device_id": deviceId, "device_id": deviceId,
} }
@@ -131,7 +131,7 @@ func (d *Device) GetAttribute(deviceId uint32) (*map[string]any, error) {
if result.Code != 0 { if result.Code != 0 {
return nil, fmt.Errorf("%s", result.Message) return nil, fmt.Errorf("%s", result.Message)
} }
return &result.Data, nil return result.Data, nil
} }
// 更新设备版本信息 // 更新设备版本信息