getDeviceConfig(params: GetDeviceConfigParams)

Requires:
@tuya-miniapp/cloud-api≥1.0.5

Description

Get device service configuration items

Parameters

ParameterTypeRequiredDescription
YesRequest body

Return Value

Type: Promise<GetDeviceConfigResult & Object↓>
Configuration query result, with the UUID from the request context attached (see implementation return type)
PropertyTypeDescription
uuidstringDevice UUID

Referenced Types

typeGetDeviceConfigResult
PropertyTypeDescription
hadServicebooleanWhether the related service is enabled
switchState0 | 1Master switch state (0 / 1)
configItemListDeviceServiceConfigItemDto[]Configuration item list

Valid Values

GetDeviceConfigParams.serviceBusinessType
ValueDescriptionSince
aiSmartFreeEvent--
aiSmartFreeEventImage2Text--
GetDeviceConfigResult.switchState
ValueDescriptionSince
0--
1--

Examples

Request example

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

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

Response example

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