getBindRuleList

Requires:
@ray-js/ray≥1.4.61

Method signature
getBindRuleList(params: )

Description

Query scenes bound to the device condition

Parameters

ParameterTypeRequiredDescription
YesQuery parameters

Return Value

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

Referenced Types

interfaceIBindRuleListItem
PropertyTypeDescription
associativeEntityIdAssociativeEntityIdEstablish a binding with a panel/device, typically using a device ID, DP, group, rule, or dpId#value
[]List of associated entity values
bindIdnumberBinding ID, typically used for unbinding
bizDomainstringBusiness domain
enablebooleanWhether enabled
sourceEntityIdstringDevice ID
enumEntityType
ValueActual ValueDescription
EntityType.DEVICE1Associated entity is a device
EntityType.RULE2Associated entity is a linkage rule
typeAssociativeEntityId
type AssociativeEntityId = string;

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