ty.device.addTimer
添加定时
需引入
DeviceKit,且在>=1.2.6版本才可使用。
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| deviceId | string | 否 | deviceId 设备 ID,deviceId 和 groupId 至少传一个 | |
| groupId | string | 否 | groupId 群组 ID,deviceId 和 groupId 至少传一个 | |
| category | string | 是 | category 定时分类 | |
| timer | AddTimerModel | 是 | timer 添加定时模型 | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
object.success 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| timerId | string | timerId 定时器 ID |
object.fail 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| errorMsg | string | 插件错误信息 |
| errorCode | string | 错误码 |
| innerError | object | 插件外部依赖错误信息 {errorMsg: string, errorCode: string } |
AddTimerModel
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| time | string | 是 | time 定时器运行的时间 | |
| loops | string | 是 | loops 七位数字字符串,"1000000" 代表周日,"0100000" 代表周一 | |
| dps | any | 是 | dps dp 点数据,示例: { "1": true, "2": false } | |
| aliasName | string | 是 | aliasName 别名 | |
| isAppPush | boolean | 是 | isAppPush 是否发送执行通知 |
ty.device.updateTimer
更新定时
需引入
DeviceKit,且在>=1.2.6版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| deviceId | string | 否 | deviceId 设备 id,deviceId 和 groupId 至少传一个 | |
| groupId | string | 否 | groupId 群组 id,deviceId 和 groupId 至少传一个 | |
| timer | UpdateTimerModel | 是 | timer 更新定时模型 | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
UpdateTimerModel
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| timerId | string | 是 | timerId 定时器 id | |
| time | string | 是 | time 定时器运行的时间 | |
| loops | string | 是 | loops 七位数字字符串,"1000000" 代表周日,"0100000" 代表周一 | |
| dps | any | 是 | dps dp 点数据,示例: { "1": true, "2": false } | |
| aliasName | string | 是 | aliasName 别名 | |
| isAppPush | boolean | 是 | isAppPush 是否发送执行通知 |
ty.device.removeTimer
删除定时
需引入
DeviceKit,且在>=1.2.6版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| deviceId | string | 否 | deviceId 设备 id,deviceId 和 groupId 至少传一个 | |
| groupId | string | 否 | groupId 群组 id,deviceId 和 groupId 至少传一个 | |
| timerId | string | 是 | timerId 定时器 id | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
👉 立即开发。
ty.device.syncTimerTask
同步定时任务
需引入
DeviceKit,且在>=1.2.6版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| deviceId | string | 否 | deviceId 设备 id ,deviceId 和 groupId 至少传一个 | |
| groupId | string | 否 | groupId 群组 id ,deviceId 和 groupId 至少传一个 | |
| category | string | 是 | category 定时分类 | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
object.success 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| timers | array | timers 定时列表 |
object.fail 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| errorMsg | string | 插件错误信息 |
| errorCode | string | 错误码 |
| innerError | object | 插件外部依赖错误信息 {errorMsg: string, errorCode: string } |
ty.device.updateTimerStatus
更新定时状态
需引入
DeviceKit,且在>=1.2.6版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| deviceId | string | 否 | deviceId 设备 id,deviceId 和 groupId 至少传一个 | |
| groupId | string | 否 | groupId 群组 id,deviceId 和 groupId 至少传一个 | |
| timerId | string | 是 | timerId 定时 id | |
| status | boolean | 是 | status 状态 | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
ty.device.onTimerUpdate
定时变化事件
需引入
DeviceKit,且在>=1.2.6版本才可使用
ty.device.offTimerUpdate
取消监听:定时变化事件
需引入
DeviceKit,且在>=2.1.6版本才可使用
ty.device.openTimerPage
跳转定时界面
需引入
DeviceKit,且在>=1.2.6版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| deviceId | string | 是 | deviceId 设备 id ,deviceId 和 groupId 至少传一个 | |
| category | string | 是 | category 定时分类 | |
| repeat | number | 否 | repeat 0 表示需要选择重复,1 表示不需要 | |
| data | array | 是 | data dp 数据 { "dpName": dp 点名称,string "dpId": dp 点 id,string "selected": dp 点默认值的 index,t.Integer "rangeKeys": dp 点的值范围,Array<object> "rangeValues": dp 点的显示数据范围,Array<string> } | |
| timerConfig | TimerConfig | 否 | timerConfig UI 配置 | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
TimerConfig
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| background | string | 否 | background 定时界面导航栏的背景颜色,十六进制,例如:FFFFFF |
👉 立即开发。
1119

被折叠的 条评论
为什么被折叠?



