Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix _connect hang when not registered device #50

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions aiocomfoconnect/comfoconnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from aiocomfoconnect.exceptions import (
AioComfoConnectNotConnected,
AioComfoConnectTimeout,
ComfoConnectNotAllowed,
)
from aiocomfoconnect.properties import Property
from aiocomfoconnect.sensors import Sensor
Expand Down Expand Up @@ -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)
Expand Down
Loading