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

## getSmartEventSwitchState

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

### 描述

查询智能事件开关

### 参数

`Params`

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

### 引用对象

##### `type` GetSmartEventSwitchStateParams

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `devId` | `string` | 设备 id |
| `serviceBusinessType` | `"aiSmartFreeEvent" \| "aiSmartFreeEventImage2Text"` | 智能事件业务类型 |


### 示例代码

#### 请求示例

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

getSmartEventSwitchState({
  devId: 'vdevo1',
  serviceBusinessType: 'aiSmartFreeEvent',
})
  .then((r) => console.log(r))
  .catch(console.error);
```

#### 返回示例

```json
{ "hadService": true, "switchState": 1, "extContent": "{}" }
```
