diff --git a/matter_server/server/device_controller.py b/matter_server/server/device_controller.py index cfc8bd7b..9504faa0 100644 --- a/matter_server/server/device_controller.py +++ b/matter_server/server/device_controller.py @@ -14,6 +14,7 @@ import time from typing import TYPE_CHECKING, Any, Callable, Iterable, TypeVar, cast +import async_timeout from chip.ChipDeviceCtrl import DeviceProxyWrapper from chip.clusters import Attribute, Objects as Clusters from chip.clusters.Attribute import ValueDecodeFailure @@ -1111,7 +1112,14 @@ async def _setup_node(self, node_id: int) -> None: return # setup subscriptions for the node try: - await self._subscribe_node(node_id) + async with async_timeout.timeout(15 * 60): + await self._subscribe_node(node_id) + except TimeoutError: + LOGGER.warning( + "Setting up subscriptions for node %s did not " + "succeed after 15 minutes!", + node_id, + ) except (NodeNotResolving, ChipStackError) as err: LOGGER.warning( "Unable to subscribe to Node %s: %s",