---
name: "getLinkageDeviceList"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.4.61" }
title: "getLinkageDeviceList"
---

## getLinkageDeviceList

> [VERSION] @ray-js/ray >= 1.4.61

### Description

Query all devices in the home that support automation

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `IGetLinkageDeviceList` | Yes | Device list query parameters |

### Return Value

Type: `Promise<ILinkageDevice[]>`

List of devices that support automation

##### ILinkageDevice

| Property | Type | Description |
| --- | --- | --- |
| `category` | `string` | Device category |
| `datapoints` | `any[]` | Device DP list |
| `devId` | `string` | Device ID |
| `iconUrl` | `string` | Device icon URL |
| `name` | `string` | Device name |
| `productId` | `string` | Product ID |

### Referenced Types

##### `interface` IGetLinkageDeviceList

| Property | Type | Description |
| --- | --- | --- |
| `gid` | `number` | Home ID |
| `sourceType` | `string` | Request type |


### Examples

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