Multi-Control Linkage UI BizBundle

Last Updated on : 2023-06-28 03:36:45download

Multi-Control Linkage UI BizBundle provides the service logic and UI to implement linking multi-control devices in the multi-control linkage module.

Functional description

In this feature, a device data point (DP) is linked with a DP of another device to create a multi-control group. When a device of the multi-control group is controlled, the linked status of other devices in the group is synchronously changed.

For example, for 3 two-gang Zigbee sub-device switches, the first DP of each switch is linked with the first DP of the other two switches to create a multi-control group. When the first DP for one of these switches is set to off, the first DP of the other two switches is synchronously set to off.

Currently, the following devices are supported by multi-control linkage:

  • Switches of Zigbee sub-devices
  • Switches of Wi-Fi devices

Integrate with the UI BizBundle

Create a project

Smart Life App SDK for Android is integrated into your project with Android Studio. The UI BizBundle is added to your project. For more information, see Integrate with Framework.

Integrate with the UI BizBundle

Add the following dependency to the file build.gradle of module:

dependencies {
  implementation 'com.tuya.smart:tuyasmart-bizbundle-control:4.2.0-33'
}

Use the feature

Check whether a device supports multi-control linkage

API description

Boolean isDeviceSupportMultiControl(String devId);

Parameters

Parameter Description
devId The device ID.

Return values of GroupState

Value Description
true Multi-control linkage is supported.
false Multi-control linkage is not supported

Example

  pluginControlService = MicroServiceManager.getInstance().findServiceByInterface(IPluginControlService.class.getName());
  Boolean bool = pluginControlService.isDeviceSupportMultiControl(devId);

Manage multi-control linkage

API description

void gotoMultiControl(Activity activity, String devId);

Parameters

Parameter Description
activity The object of Activity.
devId The device ID.

Example

  pluginControlService = MicroServiceManager.getInstance().findServiceByInterface(IPluginControlService.class.getName());
   pluginControlService.gotoMultiControl(ControlDevListActivity.this, devId);