getSceneListV2
@ray-js/ray^1.5.15
版本新增
接口描述
查询家庭下一键执行列表,会去掉失效或自动化规则。
请求参数
参数 | 数据类型 | 说明 | 是否必填 |
---|---|---|---|
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 | 动作状态 |
请求示例
import { getSceneListV2 } from '@ray-js/ray';
// Need HomeKit
const { homeId } = await home.getCurrentHomeInfo()
getSceneListV2({
devId: 'vdevo161469104176416',
gid: homeId,
})
.then((response) => {
console.log(response);
})
.catch();
返回示例
️🚫
注意,返回示例仅供参考,其包含字段大于返回参数定义范围,请勿使用除本文返回参数定义以外的返回数据,否则可能会导致程序异常。
[
{
"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"
}
]
此页内容是否对您有帮助?
是
意见反馈