diff --git a/pkg/rpc/device.go b/pkg/rpc/device.go index 330c3ed..9c6a73c 100644 --- a/pkg/rpc/device.go +++ b/pkg/rpc/device.go @@ -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{ "device_id": deviceId, } @@ -131,7 +131,7 @@ func (d *Device) GetAttribute(deviceId uint32) (*map[string]any, error) { if result.Code != 0 { return nil, fmt.Errorf("%s", result.Message) } - return &result.Data, nil + return result.Data, nil } // 更新设备版本信息