getBindRuleList(params: IGetBindRuleList)

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

描述

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

参数

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

返回值

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

引用对象

enumEntityType
枚举值实际值描述
EntityType.DEVICE1关联实体为设备
EntityType.RULE2关联实体为联动规则

合法值

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);
  }
};