Last Updated on : 2023-05-22 06:38:27
Sub-device pairing can be initiated only when a gateway is online in the cloud, and the sub-device stays in the pairing state. This topic describes the process to pair a sub-device that is connected through a Zigbee gateway.
API description
TuyaGwSubDevActivatorBuilder builder = new TuyaGwSubDevActivatorBuilder()
.setDevId(mDevId)
.setTimeOut(timeout)
.setListener(new ITuyaSmartActivatorListener() {
@Override
public void onError(String errorCode, String errorMsg) {
}
@Override
public void onActiveSuccess(DeviceBean devResp) {
}
@Override
public void onStep(String step, Object data) {
}
}
));
Parameters
Parameter | Description |
---|---|
mDevId | The gateway ID. |
timeout | The timeout value of a pairing task. Default value: 100 . Unit: seconds. |
ITuyaActivator mTuyaGWSubActivator = TuyaHomeSdk.getActivatorInstance().newGwSubDevActivator(builder);
// Starts pairing.
mTuyaGWSubActivator.start();
// Stops pairing.
mTuyaGWSubActivator.stop();
// Destroys the pairing task.
mTuyaGWSubActivator.onDestory();
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback