新增获取设备属性参数&修改返回数据结构
This commit is contained in:
@@ -41,3 +41,28 @@ type Result[D any] struct {
|
||||
Message string `json:"message"`
|
||||
Data D `json:"data"`
|
||||
}
|
||||
|
||||
// 设备详情
|
||||
type DeviceDetail struct {
|
||||
Type uint8 `json:"type"`
|
||||
ConnectType uint8 `json:"connect_type"`
|
||||
Secret string `json:"secret"`
|
||||
PId uint32 `json:"p_id"`
|
||||
DataId uint32 `json:"data_id"`
|
||||
}
|
||||
|
||||
// 设备属性参数
|
||||
type DeviceAttributeOption struct {
|
||||
Type uint8 `json:"type"`
|
||||
ContentType uint8 `json:"content_type"`
|
||||
Attribute []struct {
|
||||
Type uint8 `json:"type"`
|
||||
Name string `json:"name"`
|
||||
Flag uint8 `json:"flag"`
|
||||
Field string `json:"field"`
|
||||
Readonly bool `json:"readonly"`
|
||||
AllowItem *[]int `json:"allow_item,omitempty"`
|
||||
Min *uint32 `json:"min,omitempty"`
|
||||
Max *uint32 `json:"max,omitempty"`
|
||||
} `json:"attribute"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user