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

Add native flow/support for Improv Wi-Fi devices with Bluetooth #4686

Merged
merged 8 commits into from
Oct 10, 2024

Conversation

jpelgrom
Copy link
Member

@jpelgrom jpelgrom commented Oct 2, 2024

Summary

Adds a native flow to the app to add Improv Wi-Fi devices using the Android device's Bluetooth. This mostly follows the iOS companion app implementation but with a more Android-like UI.

Two minor changes are in this PR which aren't obviously connected to the flow:

  • the dim amount for the bottom sheet dialog is changed everywhere to match what it looks like on the Assist 'dialog'
  • the root view of WebViewActivity was changed to give the added Snackbar nice animations and make it possible to swipe to dismiss, which required a few references to be updated

This PR is submitted as a draft because the app feature is basically complete but I'm waiting for the PRs on the improv-wifi/sdk-android repo to be accepted, and hopefully we can publish the SDK instead of including an aar file. The aar file added right now is a local build of the SDK with all my PR changes included. Changes merged and library published to Maven Central.

Screenshots

The following video shows the flow:

improvflow1002-1.mp4

When tapping the frontend option to add a device, permission dialogs are shown if required (depending on Android version and what permissions the app already has), and if granted the app starts scanning in the background. If any devices are found a Snackbar will be shown. Tapping on the configure action, like frontend found devices, will trigger a sheet/dialog to select the device, enter your Wi-Fi credentials, and connect and configure. When done tapping Continue will redirect to setup that integration in the frontend.

Link to pull request in Documentation repository

n/a

Any other notes

 - Change the flow order to ask for Wi-Fi first, then connect and submit, to prevent timeout issues
 - Keep Wi-Fi details entered intact when pausing/resuming, for example because you opened your password manager app or went searching for a piece of paper
 - Align sheet step UIs and clean up padding/alignment, extract strings
 - Handle permissions
 - Fix loop with WiFi info on error
 - Start scanning on IO coroutine to prevent freeze
 - Make Snackbar show forever and use CoordinatorLayout so user can dismiss it by swiping
 - Stop scanning when navigating to another page
 - Feedback: prefill current SSID
 - Improve item height
 - Fix adding exoplayer views
 - Feedback: use column for SSID/password
 - Submit SSID/password when tapping done on keyboard
 - Implement library updates for result (redirect to domain setup)
 - Also adds dependency to automotive build
Copy link
Member

@dshokouhi dshokouhi left a comment

Choose a reason for hiding this comment

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

Looks good to me

@jpelgrom jpelgrom marked this pull request as ready for review October 10, 2024 18:16
@jpelgrom jpelgrom merged commit 3c8563c into home-assistant:master Oct 10, 2024
4 checks passed
@jpelgrom jpelgrom deleted the improv-wifi branch October 10, 2024 19:06
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.

3 participants