bindPanelAgentWithRole(params: BindPanelAgentWithRoleParams)

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

描述

绑定角色。

参数

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

返回值

类型:Promise<boolean>
BindPanelAgentWithRoleResult(字段含义见类型定义与 minituya 返回参数)

合法值

BindPanelAgentWithRoleParams.bindRoleType
值说明最低版本
0--
1--
2--

示例代码

请求示例

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('绑定结果:', result);
  })
  .catch(error => {
    console.error('绑定角色失败:', error);
  });

返回示例

true