* 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