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

feat: handle missing QR code #64

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions ovos_PHAL_plugin_homeassistant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,9 @@ def handle_qr_oauth_response(self, message):
@param message: oauth.generate.qr.response
"""
qr_code_url = message.data.get("qr")
if qr_code_url is None:
self.gui.show_notification("Failed to get QR code for Home Assistant login!")
return
LOG.info(f"Got qr code: {qr_code_url}")
self.gui.send_event("ovos.phal.plugin.homeassistant.oauth.qr.update", {
"qr": qr_code_url
Expand Down
2 changes: 1 addition & 1 deletion ovos_PHAL_plugin_homeassistant/logic/socketclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async def authenticate(self):
async def _connect(self):
try:
uri = f"{self.url}/api/websocket"
self.websocket = await websockets.connect(uri=uri, close_timeout=5, open_timeout=5)
self.websocket = await websockets.connect(uri=uri, close_timeout=5, open_timeout=5, max_size=5242880)

# Wait for the auth_required message
message = await self.websocket.recv()
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ovos-PHAL-plugin-oauth>=0.0.3
ovos-bus-client>=0.0.8
youtube-search~=2.1
pytube~=12.1
websockets>=0.54.0,<13.0
websockets>=0.54.0,<14.0 # 14.0 introduces breaking changes around asyncio, among other changes
nested-lookup~=0.2
webcolors~=1.13
websocket-client>=0.54.0,<2.0.0 # 1.0 drops Python 2 support only
Loading