Skip to content

Commit

Permalink
feat: handle missing QR code
Browse files Browse the repository at this point in the history
If the QR code is not successfully generated, send the user a notification. A notification is chosen for persistence, otherwise text on the screen may be lost on boot.

Closes #49
  • Loading branch information
mikejgray committed Jan 25, 2025
1 parent 96d9885 commit 99f7d9b
Showing 1 changed file with 3 additions and 0 deletions.
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

0 comments on commit 99f7d9b

Please sign in to comment.