getBindRuleList(params: IGetBindRuleList)

Requires:
@ray-js/ray≥1.4.61

Description

Query scenes bound to the device condition

Parameters

ParameterTypeRequiredDescription
YesQuery parameters

Return Value

Type: Promise<IBindRuleListItem[]>
List of bound rules

Referenced Types

enumEntityType
ValueActual ValueDescription
EntityType.DEVICE1Associated entity is a device
EntityType.RULE2Associated entity is a linkage rule

Valid Values

EntityType
ValueDescriptionSince
1Associated entity is a device-
2Associated entity is a linkage rule-

Examples

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(`Bind ID: ${rule.bindId}, Enabled: ${rule.enable}`);
    });
  } catch (err) {
    console.error('Query failed:', err);
  }
};