* Get and cache user information
- Add function to get information about the current user
- Cache user information alongside server in database
* Replace/prevent admin only calls
* Push Wear users to install app on phone
- Push Wear OS users to install the app on their phone if they don't already have it, as the sign in experience is a lot better and less sensitive to errors
- Allow using 'Advanced' if the user cannot or doesn't want to install the app on their phone
* Fix import
* Add time
* Update play store listing for wear OS
* Update description and add screenshots for tiles
* Update phone screenshots to be consistent and showcase some widgets
* Fix small size
* Use single screenshot to show widgets and meet requirements
* Update home screen images
* Show all widgets
* Update camera widget image, oops
* Fix screenshots
* Bump org.jlleitschuh.gradle.ktlint from 11.1.0 to 11.2.0
Bumps org.jlleitschuh.gradle.ktlint from 11.1.0 to 11.2.0.
---
updated-dependencies:
- dependency-name: org.jlleitschuh.gradle.ktlint
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
* gradlew ktlintFormat
* Rename packages with underscores
> Task :app:ktlintMainSourceSetFormat FAILED
home-assistant-android\app\src\main\java\io\homeassistant\companion\android\widgets\media_player_controls\MediaPlayerControlsWidget.kt:1:1 Package name must not contain underscore (cannot be auto-corrected)
home-assistant-android\app\src\main\java\io\homeassistant\companion\android\widgets\media_player_controls\MediaPlayerControlsWidgetConfigureActivity.kt:1:1 Package name must not contain underscore (cannot be auto-corrected)
Rename: media_player_controls to mediaplayer
> Task :wear:ktlintMainSourceSetFormat FAILED
home-assistant-android\wear\src\main\java\io\homeassistant\companion\android\onboarding\manual_setup\ManualSetupActivity.kt:1:1 Package name must not contain underscore (cannot be auto-corrected)
home-assistant-android\wear\src\main\java\io\homeassistant\companion\android\onboarding\manual_setup\ManualSetupModule.kt:1:1 Package name must not contain underscore (cannot be auto-corrected)
home-assistant-android\wear\src\main\java\io\homeassistant\companion\android\onboarding\manual_setup\ManualSetupPresenter.kt:1:1 Package name must not contain underscore (cannot be auto-corrected)
home-assistant-android\wear\src\main\java\io\homeassistant\companion\android\onboarding\manual_setup\ManualSetupPresenterImpl.kt:1:1 Package name must not contain underscore (cannot be auto-corrected)
home-assistant-android\wear\src\main\java\io\homeassistant\companion\android\onboarding\manual_setup\ManualSetupView.kt:1:1 Package name must not contain underscore (cannot be auto-corrected)
Rename: manual_setup to manual
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joris Pelgröm <joris.pelgrom@gmail.com>
* Multiserver foundation
- A foundation to build multiserver support on. Not ready for general use.
* Update new vehicle support
* Rebase fixes
* Multiserver settings
- Show settings for the correct server when editing server settings from the settings
* Bind session to device/install
- Save an install id with the app install to make sure that it isn't re-used on another device causing issues
* Add migration
- Migrate server info from shared preferences to the database after database migration and clean up
- Remove unused url shared preferences
- Read/save server version from/to database
* Fix auth error when session is refreshed
* Show server name instead of URL
- Read the server name when getting the config, and save it to the database
- Allow the user to override the server name in the app's settings
* Multiserver notifications
- Make notifications aware of which server sent the notification
- Show server name in notification if more than 1 server is added to the app
- Use the server-specific repositories when calling webhooks/authenticating/etc
* Handle multiserver in websocket worker
- Copy the settings database row to the new server ID to allow for server-level settings (websocket) while keeping the original for app-level settings (sensor update frequency), and handle this in onboarding
- Make the websocket worker check in on all servers and open/close connections where required
- Add the webhook_id to websocket notifications to link them to servers
- Update ServerManager servers to defaultServers because I'm using the same filter everywhere
* Migrate shared preferences
- Move server-specific device name to Server and secret key to ServerConnectionInfo
- Add a server ID key to the remaining shared preferences and migrate existing values
* Add option to delete server from settings
- Allow deleting servers directly from the app's settings, because you might not be able to do so from the frontend.
* WebView switching and active server management
- Allow switching which server is considered 'active' and used for the webview when loading
- On auth errors remove the server instead of removing the URLs (?)
- When getting external auth consider that the server might just have been removed (possible race condition from frontend which frequently causes 1 unauthorized connection when logging out)
- Fetch config after adding a new server to fill in name and version before first use
* Sync registrations and blocking load
- When starting the app, sync all registrations
- Remove Wear state with server but new registration required
- When receiving a new push token, update all registrations
- Do a blocking load for getting the servers because otherwise the app might think it's not registered when running in the background
* Use StateFlow for the server list
- Don't manually refresh but use a StateFlow to get updates pushed when the list of servers changes
- Make settings use unique server keys to prevent constant remove/re-add
* Sensor updates and sync with multiple servers
- Send sensor updates to all servers and sync changes to the app. Sensors are shared across all servers the app is connected to so changing enabled state on one server will update it for all servers.
- Don't update sensor enabled state for location tracking directly from onboarding, this should be done in the result.
- Remove unused SensorWithSettings class
* Send NFC tag scans to all servers
* QS tiles server selection
- Listen to updates for a specific server
- Allow selecting server if there is more than one
* Shortcuts server selection
- Allow selecting server if there is more than one
- Extract OutlinedButton with DropdownMenu for server selection to a standalone Composable
- Update QS tiles to not automatically reset server ID when server no longer exists, align with shortcuts
* Fix revoked sessions + crashing app
- When a session is revoked update the session object to reflect it
- Fix app crashes on revoked sessions because of race conditions with the AlertDialog causing window active/inactive at the same time as finishing it
* Extra server onboarding tweaks
- Skip welcome and location
- Save/fix notification preference for minimal version
* Fix sensor state type conversion errors for new servers
- If the state is removed but the type isn't, this can result in unwanted conversions throwing errors so remove the state type as well when copying a sensor
* Matter multiserver
- Request specific server ID in Matter functions
- Add server selection to shared Matter device flow
* Android Auto multiserver
- Allow switching server in Android Auto. Defaults to active server, note that it doesn't change the default but only changes it in AA.
* Widgets server selection
- Add server selection to all widgets and update handling to use the selected server
* Clean up TODOs out of scope
* Device controls multiserver
- Subscribe to updates for each server that controls are added for
- Allow managing lock screen enabled controls for each server
* Don't try to register sensors when finishing
- Don't try to do a sensor update when finishing, as this may cause unintended use of resources we're trying to clean up (when deleting a server)
* Server-level zones and location tracking
- Keep track of which server a zone belongs to for location tracking, and send updates only to that server
- Add server name to zone selection setting
* Merge fix
* Show 'Activate Server' any time there are multiple servers
- If the user is looking for the option to go to their server why hide it if it is already used, making them go back twice?
* More consistent strings
* Improve add server feedback in settings
- Preserve the activate server before adding a new one to prevent unexpected active server changes
- Show a Snackbar when another server is added indicating success with a button to activate it, or failure
* Remove unused ServerManager
* Fix tag import
- Allow the Wear support libraries to specify the redirect URI to use for OAuth login
- Catch any exceptions that might be thrown when building an OAuth request
* Move server settings to a server settings screen
- Move server-specific settings to a new screen to be accessed from the main settings only containing server specific settings in preparation for multiserver
- Sensors is currently not server-specific even though one setting is stored by server ID, to be fixed later
* Store app preferences in another shared preferences file
- Store app preferences not in the integration shared preferences file, but in the shared preferences file for general prefs (it is named themes but there are already other app-level prefs in it)
- Move Wear specific preferences to it's own repository + shared preferences file
* Improve server row with local data
- While we don't have a server name or user name, show the registration name when available to improve the server row layout
* Simplify location permission request code
- Remove the flexible permission requests as it isn't used in the current settings structure, only expect location permissions
- Switch from the deprecated functions to the new flow using activity result contracts
* Remove unused string
* Update conversation UI with speech bubble
* Clean up design, vibrate when displaying response, close activity if screen turns off
* Review comments
* Switch response side to better match frontend
* Design tweaks
* Use row padding instead of spacer
* Initial commit of wear OS notifications
* Update to allow message and title
* Move constants to object to reduce imports
* Split up logic to match phone app
* Update readme and set websocket to false for wear OS
* Bump firebase BOM
* Add a tile to interact with conversation integration
* Check HA core version and that conversation is enabled
* Rename search to conversation
* Add some TODOs, review comments for more clean up
* Review comment
* Add back private set
* Only subscribe to favorite entities on Wear OS homescreen
* Switch to subscribing to all supported domains
* Update entity states when app is resumed and entities are loaded to keep things in sync
* Only update domains when needed
* Update all registeries when we resume
* Move UI update to view model
* Review comment
* Clear values before updates
* Process review comments
* Switch from viewmodelscope to lifecyclescope for external collections
* Check loading state before collecting
* Revert previous changes for checking loading state
* Skip collection if not connected
* Simplify launching collections
* Add daily floors sensor for Wear OS3 devices
* Do a compatibility check for sensor availability in health services
* Print more logs and attempt to send latest data, update more getAvailableSensor methods
* Process review comments
* Process more review comments, use actual time in millis
* Clear out available sensors when updating with new list
* Log the capabilities in case we need to troubleshoot later
* Review comment
* Missed one additional review comment
* Return immediately instead of storing a list
* Add caching of favorites, results in prettier loading
* Update wear/src/main/java/io/homeassistant/companion/android/home/MainViewModel.kt
Co-authored-by: Joris Pelgröm <jpelgrom@users.noreply.github.com>
* Implement a lot suggestions from @jpelgrom
Revert previous changes to database and implement properly
* Apply suggestions from code review
Co-authored-by: Joris Pelgröm <jpelgrom@users.noreply.github.com>
* Implement suggestions from @jpelgrom
* Remove null assertions from icon function
* Update wear/src/main/java/io/homeassistant/companion/android/home/views/MainView.kt
Co-authored-by: Joris Pelgröm <jpelgrom@users.noreply.github.com>
* Fallback to entity ID if friendly_name is missing when creating cache,
Remove wrapper function to delete cached items
* Remove "clear cache" button
* Implement changes by @jpelgrom
Co-authored-by: Joris Pelgröm <jpelgrom@users.noreply.github.com>
* Add user activity sensor from health services for Wear OS
* Only add health services if device supports it
* Move library initialization to after isEnabled check
* Review comments
* Add permissions requests to wear OS sensors
* Add intents for network sensors on wear
* Separate background/foreground location permission requests
* Prompt for background permissions after foreground was successful
* Only set sensor to enabled if all permissions are grantted
* Review comments
* Process more review comments
* Remove unnecessary variable update
* Request notification permission during onboarding
- When using Android 13 or the minimal version, add a screen to onboarding to request to enable notifications on the device. This screen is based on iOS onboarding. When tapping Continue, on Android 13 this requests the system permission and/or on the minimal version this changes the websocket setting.
- Compile with and target SDK 33 (targeting required to be able to request notification system permission on demand)
* Add notification settings link in settings when off
- Show a new setting in settings for the user to enable notifications for the Home Assistant app, either because the permission was denied (Android 13) or the user manually turned off all notifications (Android 8-12).
- This new setting replaces the notification channels setting when everything is off; in this case there is no point managing individual channels. If at least one channel is on, the existing notification channels setting is shown instead.
* Compose tweaks
- Remove redundant content description for icon
- Change to a simpler scroll modifier
* Fix skipping notifications on minimal version
- Ensure that the value is actually saved to the database
* Post Bluetooth on/off commands as if invalid
- When using Android 13, post notification commands to control Bluetooth on/off as a normal notification as if they were invalid, as the function has been deprecated for the app
* Remove type that can be inferred
- Update Gradle to latest version (7.5.1)
- Update Android Gradle plugin to latest version (7.3.0)
- Move package property out of manifest into gradle build files namespace as recommended
Don't collapse lists by default if there's only one key
- If there is only one key, the app shouldn't collapse it by default as the app may not use a collapsible header in that case
* Always do Wear onboarding on phone
- Switch the Wear onboarding to always use the sign in flow on the paired phone, instead of offering the option to sign in completely on the watch.
- When opening the companion app using the Wear app, immediately link the user to the list of instances or sign in screen.
- Use standard OAuth flow for devices without companion app installed.
- Fix type casting of location preference in Wear onboarding result.
* Fix ListenableFuture await import
- Catch exceptions thrown when executing calls to change an entity state instead of crashing the app
- When revoking a session fails continue with logout as the server might no longer be available and the user otherwise might be 'locked in' with no way to change the server
* Always collapse headers and add favorites section
* Remove unneeded entity update subscription
* Process comments
* Use shorthand for favorites loop in MainView
* Remove error message on null template
- Null is a valid value for a template so the app should reflect that instead of suggesting there is an error, which may cause users to start looking in the wrong place.
* Log.e instead of Log.i
* Implement styling on the template tyle
* Also process preview in phone settings
* Small cleanup
* Improve template null handling
* Update template rendering error
* Update help text to indicate new line and markup options
* Also support newline
* More extensive replacement for <br>
- Add specific error if the app encounters a HTTP 404 response during onboarding registration, because that means the mobile_app integration is missing
- After an error, clean up the session data to make sure a new registration attempt is made
* Show entity state on entity chip in Wear OS app
- Shows the color and position of an entity state on the entity's chip in the Wear OS app by using a custom background class that accepts more than a single Color
* Use horizontal instead of diagonal gradients
- The default BrushPainter actually isn't the correct one, the ToggleChip class uses its own but that is marked as internal and we cannot override the default BrushPainter so another copied class it is
* RTL entity position support
- When using an RTL language, the entity chip should fill in the position value from the right side
* Support cover position
- Show cover position as entity chip's background
- Adjust background color code to also work when a chip isn't checked for covers that are currently closing
* Cleanup EntityUi
* Cleanup duplicate code in device controls
* Naming conventions
- Should've used a lowercase letter to start
- Fix class
* Fix build
- Updates because ToggleChipColors has changed
- Add workaround for implementing Compose interface because kotlin-gradle-plugin is linked to stable Compose and we cannot update yet
* Update gradient values to match rc02
- Wear Compose 1.0.0-rc02 changed the default values for the gradients in ToggleChips, so update the values used when using a custom background to match