Skip to content

Commit 10a82f5

Browse files
adamiwaniukAdam h1Iwaniuk/h1
and
Adam h1Iwaniuk/h1
authored
fix _connect hang when not registered device (#50)
Co-authored-by: Adam h1Iwaniuk/h1 <adamiwaniuk@gmail.com>
1 parent d66b747 commit 10a82f5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

aiocomfoconnect/comfoconnect.py

+6
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from aiocomfoconnect.exceptions import (
3434
AioComfoConnectNotConnected,
3535
AioComfoConnectTimeout,
36+
ComfoConnectNotAllowed,
3637
)
3738
from aiocomfoconnect.properties import Property
3839
from aiocomfoconnect.sensors import Sensor
@@ -113,6 +114,11 @@ async def _reconnect_loop():
113114
# Reconnect when connection has been dropped
114115
_LOGGER.info("We got disconnected. Reconnecting.")
115116

117+
except ComfoConnectNotAllowed as exception:
118+
# Passthrough exception if not allowed (because not registered uuid for example )
119+
connected.set_exception(exception)
120+
return
121+
116122
reconnect_task = self._loop.create_task(_reconnect_loop())
117123
self._tasks.add(reconnect_task)
118124
reconnect_task.add_done_callback(self._tasks.discard)

0 commit comments

Comments
 (0)