2 Commits

Author SHA1 Message Date
a05373e50c 修改设备参数返回值 2025-10-17 17:31:52 +08:00
df5fb556a0 修改自动化方法返回数据参数 2025-10-17 17:10:47 +08:00
2 changed files with 14 additions and 14 deletions

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{
"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
}
// 更新设备版本信息

View File

@@ -127,7 +127,6 @@ type AutomationCondition struct {
}
// 自动化动作
type AutomationAction struct {
Id uint32 `json:"id"` // ID
Type uint8 `json:"type"` // 类型
@@ -150,7 +149,8 @@ type AutomationTask struct {
RepeatType uint8 `json:"repeat_type"` // 重复类型
CustomRepeatRange []uint8 `json:"custom_repeat_range"` // 自定义重复范围
IsSatisfyAll uint8 `json:"is_satisfy_all"` // 是否要满足所有条件
ConditionList []AutomationCondition `json:"condition_list"` // 条件列表
EventConditionList []AutomationCondition `json:"event_condition_list"` // 事件条件列表
StatusConditionList []AutomationCondition `json:"status_condition_list"` // 事件条件列表
ActionList []AutomationAction `json:"action_list"` // 动作列表
}