getLinkageDeviceList(params: IGetLinkageDeviceList)

Requires:
@ray-js/ray≥1.4.61

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

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