diff --git a/src/controller/python/chip/ChipDeviceCtrl.py b/src/controller/python/chip/ChipDeviceCtrl.py index c3d727fd962852..1ca5a64e7cf198 100644 --- a/src/controller/python/chip/ChipDeviceCtrl.py +++ b/src/controller/python/chip/ChipDeviceCtrl.py @@ -2074,17 +2074,18 @@ def NOCChainCallback(self, nocChain): self._issue_node_chain_context.future.set_result(nocChain) return - def IssueNOCChain(self, csr: Clusters.OperationalCredentials.Commands.CSRResponse, nodeId: int): + async def IssueNOCChain(self, csr: Clusters.OperationalCredentials.Commands.CSRResponse, nodeId: int): """Issue an NOC chain using the associated OperationalCredentialsDelegate. The NOC chain will be provided in TLV cert format.""" self.CheckIsActive() with self._issue_node_chain_context as ctx: - self._ChipStack.Call( + res = await self._ChipStack.CallAsync( lambda: self._dmLib.pychip_DeviceController_IssueNOCChain( self.devCtrl, py_object(self), csr.NOCSRElements, len(csr.NOCSRElements), nodeId) - ).raise_on_error() - return ctx.future.result() + ) + res.raise_on_error() + return await asyncio.futures.wrap_future(ctx.future) class BareChipDeviceController(ChipDeviceControllerBase):