getBindRuleList

版本要求:
@ray-js/ray≥1.4.61

方法签名
getBindRuleList(params: )

描述

查询设备条件已绑定的场景

参数

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

返回值

类型:Promise<IBindRuleListItem[]>
已绑定的规则列表

引用对象

interfaceIBindRuleListItem
属性类型描述
associativeEntityIdAssociativeEntityId与面板/设备建立绑定关系,通常为设备ID、DP点、群组、规则,dpId#value等
[]关联实体的值列表
bindIdnumber绑定 id,一般用来解绑
bizDomainstring业务域
enableboolean是否启用
sourceEntityIdstring设备 ID
enumEntityType
枚举值实际值描述
EntityType.DEVICE1关联实体为设备
EntityType.RULE2关联实体为联动规则
typeAssociativeEntityId
type AssociativeEntityId = string;

合法值

EntityType
值说明最低版本
1关联实体为设备-
2关联实体为联动规则-

示例代码

import { getBindRuleList } from '@ray-js/ray';

const fetchBindRules = async () => {
  try {
    const rules = await getBindRuleList({
      bizDomain: 'wirelessSwitch',
      devId: 'device_001',
      entityType: 1,
      gid: '12345678',
    });
    rules.forEach(rule => {
      console.log(`绑定ID: ${rule.bindId}, 启用: ${rule.enable}`);
    });
  } catch (err) {
    console.error('查询失败:', err);
  }
};