getLinkageDeviceList(params: IGetLinkageDeviceList)

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

描述

查询家庭下支持联动的所有设备

参数

参数类型必填说明
是查询设备列表参数

返回值

类型:Promise<ILinkageDevice[]>
支持联动的设备列表

示例代码

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

const fetchDevices = async () => {
  try {
    const devices = await getLinkageDeviceList({
      gid: 12345678,
      sourceType: 'condition',
    });
    devices.forEach(dev => {
      console.log(`设备: ${dev.name}, ID: ${dev.devId}`);
    });
  } catch (err) {
    console.error('查询失败:', err);
  }
};