diff --git a/src/controller/python/chip/ChipDeviceCtrl.py b/src/controller/python/chip/ChipDeviceCtrl.py index 817091d049c370..48e35ef05a9819 100644 --- a/src/controller/python/chip/ChipDeviceCtrl.py +++ b/src/controller/python/chip/ChipDeviceCtrl.py @@ -110,10 +110,14 @@ def HandleKeyExchangeComplete(err): def HandleAddressUpdateComplete(nodeid, err): if err != 0: print("Failed to update node address: {}".format(err)) + # Failed update address, don't wait for HandleCommissioningComplete + self.state = DCState.IDLEHandleCommissioningComplete + self._ChipStack.callbackRes = err + self._ChipStack.completeEvent.set() else: print("Node address has been updated") - # Wait for HandleCommissioningComplete before setting - # self._ChipStack.callbackRes; we're not done until that happens. + # Wait for HandleCommissioningComplete before setting + # self._ChipStack.callbackRes; we're not done until that happens. def HandleCommissioningComplete(nodeid, err): if err != 0: