createAction
创建自动化动作
引入
import { createAction } from '@ray-js/ray';
需引入
DeviceKit,且在>=2.5.4版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| createType | string | 是 | 动作类型:device,smart,remind,delay device:设备 smart:操作某个智能(执行智能、开关自动化) remind:提醒 delay:延时 | |
| smartType | string | 是 | 智能类型:scene,auto scene:一键执行 auto:自动化 | |
| actionArray | array | 是 | 当前场景动作列表 | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
object.success 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| actionArray | array | 动作列表 |
object.fail 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| errorMsg | string | 插件错误信息 |
| errorCode | string | 错误码 |
| innerError | object | 插件外部依赖错误信息 {errorMsg: string, errorCode: string } |
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。
editAction
编辑场景动作
引入
import { editAction } from '@ray-js/ray';
需引入
DeviceKit,且在>=2.5.4版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| editIndex | string | 是 | 当前编辑的 actionIndex | |
| smartType | string | 是 | 智能类型 | |
| actionArray | SceneAction[] | 是 | 动作列表 | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
SceneAction
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| id | string | - | 条件 ID | |
| ruleId | string | - | 场景 ID | |
| orderNum | number | - | 场景 ID | |
| entityId | string | - | ✔ | 条件为设备类型时,表示设备 ID |
| entityName | string | - | 设备名称 | |
| actionExecutor | string | - | ✔ | 动作类型。枚举:ruleTrigger、ruleEnable、ruleDisable、appPushTrigger、mobileVoiceSend、smsSend、deviceGroupDpIssue、irIssue、dpIssue、delay、irIssueVii、toggle、dpStep |
| executorProperty | Record<string, {}> | - | 动作执行信息 | |
| extraProperty | Record<string, {}> | - | 动作额外信息 | |
| isDevOnline | boolean | - | 设备是否在线 | |
| devDelMark | boolean | - | 条件为设备类型时,表示设备是否被移除 | |
| deleteDevIcon | string | - | 条件为设备类型时,表示设备被删除时的图标 | |
| devIcon | string | - | 条件为设备类型时,设备的图标 | |
| actionStrategy | string | - | 动作的策略 | |
| extraPanelInfo | ExtraPanelInfo | - | 面板信息(小程序或者RN面板) | |
| pid | string | - | 设备产品 ID | |
| productId | string | - | 设备产品 ID | |
| productPic | string | - | 条件为设备类型时,表示设备产品图片 | |
| defaultIconUrl | string | - | 条件默认图标 | |
| actionDisplayNew | Record<string, {}> | - | 动作展示信息 | |
| status | boolean | - | 执行状态 | |
| relationGroup | Record<string, {}> | - | 批量控制设备的数据 |
object.success 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| actionArray | array | 动作列表 |
object.fail 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| errorMsg | string | 插件错误信息 |
| errorCode | string | 错误码 |
| innerError | object | 插件外部依赖错误信息 {errorMsg: string, errorCode: string } |
saveSceneAction
保存场景动作数据
引入
import { saveSceneAction } from '@ray-js/ray';
需引入
DeviceKit,且在>=2.5.4版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| deviceId | string | 是 | 设备 id | |
| taskPosition | number | 是 | 动作的索引位置 | |
| actionExecutor | string | 否 | 动作执行器 | |
| executorProperty | any | 是 | 动作执行信息 | |
| extraProperty | any | 是 | 动作额外信息 | |
| actionDisplayNew | any | 是 | 动作展示信息 | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。

1218

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



