SmartTapToRunAbility.getBindTapToRunRules(params?: TapToRunQueryParams)

版本要求:
@ray-js/panel-sdk≥1.11.0

描述

查询已绑定一键执行的联动列表

参数

参数类型必填说明
否查询参数

返回值

类型:Promise<BindTapToRunRules>
已绑定的一键执行规则列表

引用对象

typeBindTapToRunRules已绑定的一键执行联动规则列表
export type BindTapToRunRules = BindTapToRunRule[];
typeBindTapToRunRule已绑定的一键执行项
属性类型描述
associativeEntityIdstring关联实体 ID,格式为 dpId#dpValue
关联实体的值列表
bindIdnumber绑定 ID
bizDomainstring业务域,一键执行固定为 wirelessSwitchBindScene
enableboolean是否启用
sourceEntityIdstring源设备 ID
typeBindTapToRunLinkedRule已绑定的一键执行目标规则
属性类型描述
ruleTypenumber规则类型
triggerRuleEnableboolean规则是否启用
triggerRuleIdstring执行规则 ID,一般用来进行触发
typeTapToRunRule可绑定的一键执行规则
属性类型描述
执行动作列表
backgroundstring背景图地址
boundForPanelboolean面板绑定
boundForWiFiPanelbooleanWiFi 面板绑定
coverIconstring图标
displayColorstring背景颜色
enabledboolean规则是否启用
idstring执行规则 ID
namestring联动名称或备注
typeTapToRunAction一键执行动作项
属性类型描述
actionDisplaystring执行动作的显示名称
actionExecutorstring执行动作的执行者
actionStrategystring执行动作的执行策略
entityIdstring动作所属实体 ID
gmtModifiednumber修改时间戳
idstring动作唯一 ID
orderNumnumber动作顺序号
ruleIdstring规则 ID
statusboolean动作状态

示例代码

示例

const bindRules = await sdm.tapToRun.getBindTapToRunRules();
bindRules.forEach(item => {
  console.log('绑定 ID:', item.bindId);
  item.associativeEntityValueList.forEach(rule => {
    console.log('已绑定规则:', rule.id, rule.name);
  });
});