bindPanelAgentWithRole(params: BindPanelAgentWithRoleParams)

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

Description

Bind a role.

Parameters

ParameterTypeRequiredDescription
YesRequest body

Return Value

Type: Promise<boolean>
BindPanelAgentWithRoleResult (see type definitions and minituya response parameters for field meanings)

Valid Values

BindPanelAgentWithRoleParams.bindRoleType
ValueDescriptionSince
0--
1--
2--

Examples

Request example

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

const params = {
  devId: 'your_device_id',
  bindRoleType: 0,
  roleId: 'role_custom_12345',
};

bindPanelAgentWithRole(params)
  .then(result => {
    console.log('Binding result:', result);
  })
  .catch(error => {
    console.error('Failed to bind role:', error);
  });

Response example

true