getLinkageDeviceList

Requires:
@ray-js/ray≥1.4.61

Method signature
getLinkageDeviceList(params: )

Description

Query all devices in the home that support automation

Parameters

ParameterTypeRequiredDescription
YesDevice list query parameters

Return Value

Type: Promise<ILinkageDevice[]>
List of devices that support automation

Referenced Types

interfaceILinkageDevice
PropertyTypeDescription
categorystringDevice category
datapointsany[]Device DP list
devIdstringDevice ID
iconUrlstringDevice icon URL
namestringDevice name
productIdstringProduct ID

Examples

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

const fetchDevices = async () => {
  try {
    const devices = await getLinkageDeviceList({
      gid: 12345678,
      sourceType: 'condition',
    });
    devices.forEach(dev => {
      console.log(`Device: ${dev.name}, ID: ${dev.devId}`);
    });
  } catch (err) {
    console.error('Query failed:', err);
  }
};