diff --git a/aiocomfoconnect/comfoconnect.py b/aiocomfoconnect/comfoconnect.py index f81f7d0..f0a4e66 100644 --- a/aiocomfoconnect/comfoconnect.py +++ b/aiocomfoconnect/comfoconnect.py @@ -33,6 +33,7 @@ from aiocomfoconnect.exceptions import ( AioComfoConnectNotConnected, AioComfoConnectTimeout, + ComfoConnectNotAllowed, ) from aiocomfoconnect.properties import Property from aiocomfoconnect.sensors import Sensor @@ -113,6 +114,11 @@ async def _reconnect_loop(): # Reconnect when connection has been dropped _LOGGER.info("We got disconnected. Reconnecting.") + except ComfoConnectNotAllowed as exception: + # Passthrough exception if not allowed (because not registered uuid for example ) + connected.set_exception(exception) + return + reconnect_task = self._loop.create_task(_reconnect_loop()) self._tasks.add(reconnect_task) reconnect_task.add_done_callback(self._tasks.discard)