-
Notifications
You must be signed in to change notification settings - Fork 0
/
interface.go
25 lines (18 loc) · 1.07 KB
/
interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package thingmodel
import (
"context"
"github.com/tuya/tuya-tedge-driver-sdk-go/commons"
)
type ThingModelDriver interface {
// DeviceNotify 设备增删改通知,删除设备时device参数为空
DeviceNotify(ctx context.Context, t commons.DeviceNotifyType, cid string, device commons.TMDeviceInfo) error
// ProductNotify 产品增删改通知,删除产品时product参数为空
ProductNotify(ctx context.Context, t commons.ProductNotifyType, pid string, product ThingModelProduct) error
// HandlePropertySet set device property, from cloud or web
HandlePropertySet(ctx context.Context, cid string, data PropertySet, protocols map[string]commons.ProtocolProperties) error
// HandlePropertyGet get device property, from cloud
HandlePropertyGet(ctx context.Context, cid string, data PropertyGet, protocols map[string]commons.ProtocolProperties) error
// HandleActionExecute device command, from cloud or web
HandleActionExecute(ctx context.Context, cid string, data ActionExecuteRequest, protocols map[string]commons.ProtocolProperties) error
Stop(ctx context.Context) error
}