Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a05373e50c | |||
| df5fb556a0 | |||
| 6a25b6acc7 |
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新设备版本信息
|
// 更新设备版本信息
|
||||||
|
|||||||
@@ -127,7 +127,6 @@ type AutomationCondition struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 自动化动作
|
// 自动化动作
|
||||||
|
|
||||||
type AutomationAction struct {
|
type AutomationAction struct {
|
||||||
Id uint32 `json:"id"` // ID
|
Id uint32 `json:"id"` // ID
|
||||||
Type uint8 `json:"type"` // 类型
|
Type uint8 `json:"type"` // 类型
|
||||||
@@ -141,17 +140,18 @@ type AutomationAction struct {
|
|||||||
|
|
||||||
// 自动化任务
|
// 自动化任务
|
||||||
type AutomationTask struct {
|
type AutomationTask struct {
|
||||||
Id uint32 `json:"id"` // ID
|
Id uint32 `json:"id"` // ID
|
||||||
Title string `json:"title"` // 标题
|
Title string `json:"title"` // 标题
|
||||||
CreateUserId uint32 `json:"create_user_id"` // 创建用户ID
|
CreateUserId uint32 `json:"create_user_id"` // 创建用户ID
|
||||||
EffectivePeriod uint8 `json:"effective_period"` // 生效时段
|
EffectivePeriod uint8 `json:"effective_period"` // 生效时段
|
||||||
PeriodBeginTime *string `json:"period_begin_time,omitempty"` // 时段开始时间
|
PeriodBeginTime *string `json:"period_begin_time,omitempty"` // 时段开始时间
|
||||||
PeriodEndTime *string `json:"period_end_time,omitempty"` // 时段结束时间
|
PeriodEndTime *string `json:"period_end_time,omitempty"` // 时段结束时间
|
||||||
RepeatType uint8 `json:"repeat_type"` // 重复类型
|
RepeatType uint8 `json:"repeat_type"` // 重复类型
|
||||||
CustomRepeatRange *[]uint8 `json:"custom_repeat_range,omitempty"` // 自定义重复范围
|
CustomRepeatRange []uint8 `json:"custom_repeat_range"` // 自定义重复范围
|
||||||
IsSatisfyAll uint8 `json:"is_satisfy_all"` // 是否要满足所有条件
|
IsSatisfyAll uint8 `json:"is_satisfy_all"` // 是否要满足所有条件
|
||||||
ConditionList []AutomationCondition `json:"condition_list"` // 条件列表
|
EventConditionList []AutomationCondition `json:"event_condition_list"` // 事件条件列表
|
||||||
ActionList []AutomationAction `json:"action_list"` // 动作列表
|
StatusConditionList []AutomationCondition `json:"status_condition_list"` // 事件条件列表
|
||||||
|
ActionList []AutomationAction `json:"action_list"` // 动作列表
|
||||||
}
|
}
|
||||||
|
|
||||||
// 系统位置
|
// 系统位置
|
||||||
|
|||||||
Reference in New Issue
Block a user