getVoiceprintDeviceConfig(params: GetVoiceprintDeviceConfigParams)

Requires:
@tuya-miniapp/cloud-api≥1.x.x

Description

Get the device's voiceprint device configuration.

Parameters

ParameterTypeRequiredDescription
YesRequest parameters

Return Value

Type: Promise<VoiceprintDeviceConfig>
GetVoiceprintDeviceConfigResult (for field meanings, see the type definition and minituya response parameters)

Referenced Types

interfaceVoiceprintDeviceConfigVoiceprint device configuration
PropertyTypeDescription
gidstringAssociated home ID
deviceIdstringAssociated device ID
enableRecognize0 | 1Whether to enable voiceprint recognition (0 = no, 1 = yes)
enableAutoRegister0 | 1Whether to enable automatic voiceprint enrollment (0 = no, 1 = yes)
lockMode"off" | "specified"Voiceprint lock mode (off = unlocked, specified = lock to the specified voice user)
lockVoiceprintVoiceUserIdsstring[]Locked voice user ID
hasRecognizeAbilitybooleanWhether voiceprint recognition is enabled on the business side
hasAutoRegisterAbilitybooleanWhether automatic voiceprint enrollment is enabled on the business side

Valid Values

VoiceprintDeviceConfig.enableRecognize
ValueDescriptionSince
0--
1--
VoiceprintDeviceConfig.enableAutoRegister
ValueDescriptionSince
0--
1--
VoiceprintDeviceConfig.lockMode
ValueDescriptionSince
off--
specified--

Examples

Request example

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

const params = {
  deviceId: 'your_device_id',
};

getVoiceprintDeviceConfig(params)
  .then(result => {
    console.log('Voiceprint device config:', result);
  })
  .catch(error => {
    console.error('Failed to get voiceprint device config:', error);
  });

Response example

{
  "gid": "your_gid",
  "deviceId": "your_device_id",
  "enableRecognize": 1,
  "enableAutoRegister": 0,
  "lockMode": "off",
  "lockVoiceprintVoiceUserIds": [],
  "hasRecognizeAbility": true,
  "hasAutoRegisterAbility": false
}