shadow

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ControlAuto             = 0 //自动,当设备不在线的时候设置设备影子,设备在线时直接下发给设备
	ControlNo               = 1 //只实时下发,不在线报错
	ControlOnly             = 2 //如果有设备影子只修改影子,没有的也不下发
	ControlOnlyCloud        = 3 //只修改云端的值
	ControlOnlyCloudWithLog = 4 //只修改云端的值并记录操作日志
	ControlNoLog            = 5 //只实时下发,不在线报错,且不记录日志
)
View Source
const (
	UpdatedDevice   = 1 //已经更新到过设备
	NotUpdateDevice = 2 //尚未更新到过设备
)

Variables

This section is empty.

Functions

func CheckEnableShadow

func CheckEnableShadow(params map[string]any, model *schema.Model) error

func ToMap

func ToMap(in []*Info) map[string]*Info

func ToValues

func ToValues(in []*Info, property schema.PropertyMap) map[string]msgThing.Param

Types

type Filter

type Filter struct {
	ProductID           string
	DeviceName          string
	DataIDs             []string
	UpdatedDeviceStatus int64 //1 已经更新到过设备 2 尚未更新到过设备
}

type Info

type Info struct {
	ID                int64
	ProductID         string     // 产品id
	DeviceName        string     // 设备名称
	DataID            string     // 属性id
	Value             string     // 属性值
	UpdatedDeviceTime *time.Time //更新到设备的时间
	CreatedTime       time.Time
	UpdatedTime       time.Time
}

func NewInfo

func NewInfo(productID, deviceName string, params map[string]any) []*Info

type Repo

type Repo interface {
	FindByFilter(ctx context.Context, f Filter) ([]*Info, error)
	// MultiUpdate 批量更新 LightStrategyDevice 记录
	MultiUpdate(ctx context.Context, data []*Info) error
	// MultiDelete 批量删除 LightStrategyDevice 记录
	MultiDelete(ctx context.Context, f Filter) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL