---
name: "getCommandCache"
mode: "kit"
versionRequirements:
  - { name: "@tuya-miniapp/cloud-api", version: "1.0.5" }
---

## getCommandCache

> [VERSION] @tuya-miniapp/cloud-api >= 1.0.5

> 💡 接口依赖云能力，需在 [小程序开发者平台](https://platform.tuya.com/miniapp/) 开发设置 - 云能力 进行授权配置。

### 描述

查询指定设备在云端缓存的待下发指令（DP 点集合）。支持 Wi-Fi、ZigBee 设备。

### 参数

`Params`

| 参数 | 类型 | 必填 | 默认值 | 描述 |
| --- | --- | --- | --- | --- |
| `params` | `GetCommandCacheParams` | 是 | - | 请求体 |

### 引用对象

##### `interface` GetCommandCacheParams

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


### 示例代码

#### 请求示例

```typescript
import { getCommandCache } from '@tuya-miniapp/cloud-api';

const result = await getCommandCache({
  devId: 'your_device_id',
});
```

#### 返回示例

```json
[
  {
    "dps": {
      "switch_1": true
    },
    "pushStatus": false
  },
  {
    "dps": {
      "switch_2": true
    },
    "pushStatus": true
  }
]
```
