Skip to content
简体中文
Tuya MiniApp
开发
Ray 开发
API
场景
查询
getSceneListV2

getSceneListV2

@ray-js/ray^1.5.15 版本新增

接口描述

查询家庭下一键执行列表,会去掉失效或自动化规则。

请求参数

参数数据类型说明是否必填
devIdstring设备 ID
gidstring家庭 ID
containStandardZigBeeboolean是否包含标准场景,默认为 false

返回参数

参数数据类型说明
responseArray一键执行列表
response.actionsArray<ISceneAction>执行动作
response.backgroundstring背景图地址
response.boundForPanelboolean面板绑定
response.boundForWiFiPanelbooleanWiFi 面板绑定
response.coverIconstring图标
response.displayColorstring背景颜色
response.enabledboolean规则是否启用
response.idstring执行规则 ID
response.namestring联动名称或备注

ISceneAction

属性类型描述
actionDisplaystring执行动作的显示名称
actionExecutorstring执行动作的执行者
actionStrategystring执行动作的策略
entityIdstring实体ID,表示动作所属的实体的ID
gmtModifiednumber修改时间戳
idstring动作的唯一ID
orderNumnumber动作的顺序号
ruleIdstring规则ID,表示动作所属的规则的ID
statusboolean动作状态

请求示例

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"
  }
]
此页内容是否对您有帮助?
意见反馈
小程序机器人助手
需求提交
|
论坛反馈
|
问卷调查
|
官方群聊