---
name: "removeRule"
mode: "api"
versionRequirements:
  - { name: "基础库", version: "2.14.0" }
title: "device.removeRule - 解除联动"
---

## removeRule

> [VERSION] 基础库 >= 2.14.0

### 描述

解除联动关联关系

### 参数

`Params`

| 参数 | 类型 | 必填 | 描述 |
| --- | --- | --- | --- |
| `params` | `IRemoveRule` | 是 | 解除参数 |

### 返回值

类型: `Promise<boolean>`

解除是否成功

### 引用对象

##### `interface` IRemoveRule

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `bizDomain` | `string` | 业务域 |
| `sourceEntityId` | `string` | 源实体 ID，默认使用 devId |
| `devId` | `string` | 设备 ID |
| `associativeEntityId` | `string` | 关联实体 ID |
| `associativeEntityValue` | `string` | 关联实体值（规则 ID） |
| `gid` | `string` | 家庭 ID |


### 示例代码

#### 解除联动

```ts
ty.removeRule({
  bizDomain: 'switch',
  devId: 'abc123',
  associativeEntityId: 'dp_1#true',
  associativeEntityValue: 'rule_001',
  gid: '456789',
}).then((success) => {
  console.log('解除结果', success);
});
```
