---
name: "getZigbeeLocalGroupRelation"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.5.2" }
title: "getZigbeeLocalGroupRelation - 获取 Zigbee 遥控器群组 localId 列表"
---

## getZigbeeLocalGroupRelation

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

### 描述

获取 Zigbee 遥控器群组 localId 列表

### 参数

`Params`

| 参数 | 类型 | 必填 | 描述 |
| --- | --- | --- | --- |
| `params` | `IGetZigbeeLocalGroupRelation` | 是 | 请求参数 |

### 返回值

类型: `Promise<IGetZigbeeLocalGroupRelationResponse>`

包含 locals 数组的对象，每个元素包含 code、order、localId、categoryCode 信息

##### IGetZigbeeLocalGroupRelationResponse

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `locals` | `IZigbeeLocalGroupRelationItem[]` | 遥控器群组 localId 关系列表 |

### 引用对象

##### `interface` IGetZigbeeLocalGroupRelation

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `devId` | `string` | 遥控器设备 ID |

##### `interface` IZigbeeLocalGroupRelationItem

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `code` | `string` | 功能点 code |
| `order` | `number` | 排序 |
| `localId` | `string` | 设备端用到的群组 localId |
| `categoryCode` | `string` | 面板使用的 code，用来做映射，值以 300 为前缀，例如 3001 |


### 示例代码

#### 基础用法

```ts
import { getZigbeeLocalGroupRelation } from '@ray-js/ray';

getZigbeeLocalGroupRelation({
  devId: 'your_device_id',
}).then((response) => {
  console.log('localId 列表:', response.locals);
}).catch((err) => {
  console.error(err);
});
```
