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

Allow mobile apps to provide QR code functionality #19570

Merged
merged 2 commits into from
Jan 31, 2024
Merged

Conversation

balloob
Copy link
Member

@balloob balloob commented Jan 29, 2024

Breaking change

Proposed change

This adds a new QR Code scanner feature to the external bus. Goal is that mobile apps will display this UI and return the scan result back to Home Assistant.

If alternative option label is not given, that link will not be shown to the user.

This PR is step 1. Next step is to ask Android/iOS to add support for this.

CleanShot 2024-01-29 at 14 45 14

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@@ -35,6 +35,13 @@ interface EMOutgoingMessageConfigGet extends EMMessage {
type: "config/get";
}

interface EMOutgoingMessageScanQRCode extends EMMessage {
type: "qr_code/scan";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also tell the app what kind of QR codes we want to scan, what to accept, or does the app give the frontend everything it finds, and we tell it if that is something we accept/scan, so if we are done and it can remove the scanner?

I'm thinking about 2 QR codes side by side on a package, you dont want the app to give the wrong code to the frontend.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can start with accepting everything. We can expand it later to limit the things it accept. I would love for the frontend to get a generic QR code scanner that could work with a new concept of QR discovery for manifest.json.

@bramkragten bramkragten merged commit b728b9e into dev Jan 31, 2024
13 checks passed
@bramkragten bramkragten deleted the qr-code-scanner branch January 31, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants