getSmartEventSwitchState(params: GetSmartEventSwitchStateParams)

版本要求:
@tuya-miniapp/cloud-api≥1.0.5

描述

查询智能事件开关

参数

参数类型必填说明
是请求体

返回值

类型:Promise<GetSmartEventSwitchStateResult>
hadService、switchState、extContent

引用对象

typeGetSmartEventSwitchStateResult
属性类型描述
hadServiceboolean是否已开通相关服务
switchState0 | 1开关状态(0 / 1)
extContentstring扩展内容(JSON 字符串)

合法值

GetSmartEventSwitchStateParams.serviceBusinessType
值说明最低版本
aiSmartFreeEvent--
aiSmartFreeEventImage2Text--
GetSmartEventSwitchStateResult.switchState
值说明最低版本
0--
1--

示例代码

请求示例

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

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

返回示例

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