智能小程序 Ray 开发面板 SDK —— 智能设备模型通用能力一键执行 SDK 汇总(一)
getTapToRunRules
描述
查询当前家庭下可绑定的一键执行列表,会去掉失效或自动化规则。
请求参数
参数 | 数据类型 | 说明 | 是否必填 |
---|---|---|---|
devId | string | 设备 ID,默认从设备环境中取 | 否 |
gid | string | 家庭 ID,默认从当前家庭中取 | 否 |
containStandardZigBee | boolean | 是否包含标准场景,默认为 false | 否 |
返回参数
参数 | 数据类型 | 说明 |
---|---|---|
response | Array | 一键执行列表 |
response.actions | Array<ISceneAction> | 执行动作 |
response.background | string | 背景图地址 |
response.boundForPanel | boolean | 面板绑定 |
response.boundForWiFiPanel | boolean | WiFi 面板绑定 |
response.coverIcon | string | 图标 |
response.displayColor | string | 背景颜色 |
response.enabled | boolean | 规则是否启用 |
response.id | string | 执行规则 ID |
response.name | string | 联动名称或备注 |
ISceneAction
参数 | 数据类型 | 说明 |
---|---|---|
actionDisplay | string | 执行动作的显示名称 |
actionExecutor | string | 执行动作的执行者 |
actionStrategy | string | 执行动作的策略 |
entityId | string | 实体ID,表示动作所属的实体的ID |
gmtModified | number | 修改时间戳 |
id | string | 动作的唯一ID |
orderNum | number | 动作的顺序号 |
ruleId | string | 规则ID,表示动作所属的规则的ID |
status | boolean | 动作状态 |
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。
请求示例
import { SmartTapToRunAbility } from '@ray-js/panel-sdk';const TapToRun = new SmartTapToRunAbility();
TapToRun.getTapToRunRules().then((response) => {console.log(response);}).catch();console.log('=== result: ', result);
返回示例
️🚫 注意,返回示例仅供参考,其包含字段大于返回参数定义范围,请勿使用除本文返回参数定义以外的返回数据,否则可能会导致程序异常。
[{"actions": [{"actionDisplay": "开关 : 开启","actionDisplayNew": {"83": ["开关","开启"]},"actionExecutor": "dpIssue","actionStrategy": "edge","attribute": 0,"devDelMark": false,"enabled": true,"entityId": "some deviceId","entityName": "调试产品-幻彩3路-vdevo","executorProperty": {"83": true},"extraProperty": {},"gmtModified": 1718024675855,"id": "some id","offGwSync": false,"orderNum": 1,"ruleId": "some ruleId","status": true,"uid": "some uid"}],"alarmIssue": false,"attribute": 4,"auditStatus": 0,"background": "","boundForPanel": false,"boundForWiFiPanel": false,"code": "","commonField": "{\"subMatchType\":1}","containDeviceDelete": false,"coverIcon": "some cover icon","description": "","disableTime": 0,"displayColor": "BA7B69","enabled": true,"forceCloudTrigger": false,"gmtCreate": 1705027381008,"gmtModified": 1718024675861,"id": "some id","iotAutoAlarm": false,"isAlarmIssue": false,"isLogicRule": false,"linkageType": 0,"localLinkage": false,"logicRule": false,"matchType": 1,"name": "打开三路开关","needCleanGidSid": false,"needValidOutOfWork": false,"newLocalScene": false,"offGwSync": false,"offGwSyncSuccess": false,"orderWeight": 1,"outOfWork": 0,"ownerId": "some owner id","panelType": 0,"permissionCode": "","ruleGenre": 1,"ruleSource": 0,"ruleType": 3,"runtimeEnv": "prod","scenarioRule": true,"status": true,"statusConditions": [],"stickyOnTop": true,"subMatchType": 1,"uid": "some uid"}
]
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。