getDeviceConfig(params: GetDeviceConfigParams)

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

描述

获取设备服务配置项

参数

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

返回值

类型:Promise<GetDeviceConfigResult & Object↓>
配置查询结果,并附带请求上下文中的 uuid(见实现返回类型)
属性类型说明
uuidstring设备 uuid

引用对象

typeGetDeviceConfigResult
属性类型描述
hadServiceboolean是否已开通相关服务
switchState0 | 1总开关状态(0 / 1)
configItemListDeviceServiceConfigItemDto[]配置项列表

合法值

GetDeviceConfigParams.serviceBusinessType
值说明最低版本
aiSmartFreeEvent--
aiSmartFreeEventImage2Text--
GetDeviceConfigResult.switchState
值说明最低版本
0--
1--

示例代码

请求示例

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

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

返回示例

{
  "uuid": "vdevo176127325226099",
  "hadService": true,
  "switchState": 1,
  "configItemList": [
    {
      "configId": 1,
      "configCode": "cloudStorage",
      "configType": 0,
      "configValue": "1",
      "configState": 1
    }
  ]
}