---
name: "getSceneList"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.4.61" }
title: "getSceneList - 查询设备支持的一键执行场景"
---

## getSceneList

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

### 描述

查询设备支持的一键执行场景，包含失效及自动化规则

### 参数

`Params`

| 参数 | 类型 | 必填 | 描述 |
| --- | --- | --- | --- |
| `params` | `ISceneListParams` | 是 | 查询参数 |

### 返回值

类型: `Promise<ISceneListItem[]>`

联动规则列表

### 引用对象

##### `interface` ISceneListParams

| 属性 | 类型 | 必填 | 描述 |
| --- | --- | --- | --- |
| `devId` | `string` | 是 | 设备 ID |
| `gid` | `string` | 是 | 家庭 ID |


### 示例代码

```typescript
import { getSceneList } from '@ray-js/ray';

const fetchScenes = async () => {
  try {
    const scenes = await getSceneList({
      devId: 'device_001',
      gid: '12345678',
    });
    console.log('场景列表:', scenes);
  } catch (err) {
    console.error('查询失败:', err);
  }
};
```
