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

## getCameraList

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

### 描述

获取家庭摄像头设备列表

### 参数

`Params`

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

### 引用对象

##### `type` QueryCameraListDto

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `homeId` | `string` | 家庭 id |
| `stockId` | `string` | 库存 id（可选） |
| `pids` | `string` | 产品 id 列表（可选，文档为产品筛选条件） |
| `ownerType` | `1 \| 0` | 归属维度：0 设备级，1 账号级 |
| `serviceCode` | `string` | 服务 code（可选） |
| `commodityCode` | `string` | 商品编码（可选） |
| `categoryCode` | `string` | 业务分类 code（必填） |

##### `type` BindDeviceInfo

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `isBindCurrentService` | `boolean` | 是否绑定当前服务 |

##### `interface` DeviceInfo

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `productId` | `string` | 产品 id |
| `planList` | `PlanInfoDto[]` | 设备服务计划列表 |
| `isUseFreeService` | `0 \| 1` | 是否已购买订阅首期免费商品（0-未购买、1-已购买） |
| `isUseCommonUserTrail` | `0 \| 1` | 是否购买过普通试用-账号级别免费商品（0-未购买、1-已购买） |
| `isUseCommonDeviceTrail` | `0 \| 1` | 是否购买过普通试用-设备级别免费商品（0-未购买、1-已购买） |
| `isTried` | `0 \| 1` | 是否已试用商品（0-未试用、1-已试用） |
| `hasServiceOrder` | `boolean` | 是否存在服务单 |
| `icon` | `string` | 设备图标 |
| `name` | `string` | 设备名称 |
| `ownerId` | `string` | 所属家庭 ID |
| `uuid` | `string` | 设备唯一 ID |
| `roomName` | `string` | 房间名称 |
| `deviceId` | `string` | 设备 deviceId |
| `isBind` | `"DeviceBindStatus.BINDING" \\| "DeviceBindStatus.NOT_SUPPORT" \\| "DeviceBindStatus.NOT_BIND"` | 绑定状态（已绑定 / 不支持 / 未绑定） |
| `status` | `boolean` | 设备状态 |
| `aiSmartFreeDev` | `boolean` | 当前设备是否处于 aiSmart 能力白名单中 |

##### `enum` DeviceBindStatus

| 枚举值 | 实际值 | 描述 |
| --- | --- | --- |
| `DeviceBindStatus.BINDING` | `1` | 已绑定 |
| `DeviceBindStatus.NOT_SUPPORT` | `2` | 不支持 |
| `DeviceBindStatus.NOT_BIND` | `3` | 未绑定 |

##### `interface` PlanInfoDto

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `commodityCode` | `string` | 商品编码 |
| `commodityName` | `string` | 商品名称 |
| `env` | `number` | 环境标识 |
| `instanceId` | `string` | 实例 id（通常为设备 id） |
| `isSubscribe` | `0 \| 1` | 是否订阅商品（0 / 1） |
| `orderNo` | `number` | 排序序号 |
| `planStatus` | `1` | 套餐状态（如使用中） |
| `serviceBeginTime` | `number` | 服务开始时间 |
| `serviceEndTime` | `number` | 服务结束时间 |
| `stockId` | `string` | 库存 id |
| `isCanceled` | `0 \| 1` | 是否已退订（0 / 1） |
| `isAdditional` | `0 \| 1` | 是否加购/附加（0 / 1） |


### 示例代码

#### 请求示例

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

getCameraList({ homeId: '194137', categoryCode: 'ipc' })
  .then((res) => console.log(res))
  .catch(console.error);
```

#### 返回示例

```json
{
  "totalDevices": 1,
  "bindDeviceNum": 1,
  "list": [
    {
      "uuid": "vdevo176127325226099",
      "name": "摄像头 1",
      "online": true,
      "iconUrl": "https://images.example.com/icon.png",
      "isBindCurrentService": true
    }
  ]
}
```
