* 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
* Speed up loading device controls by running network async
- Speed up loading the device controls menu and initial controls by launching all requests in an async block, which allows the server to respond out of order
- For individual controls, only start listening for changes once we have provided initial controls
* Speed up Wear OS cold boot by running network async
- Speed up a cold boot of the Wear OS app by launching all network requests in an async block, which allows the server to respond out of order
* Bump compose, make it build and update loading screen
* Fix toggle icons
* Update refresh interval picker layout
* Remove potential empty item in MainView to improve content alignment in window
* Fix rotary scroll
* Fix toggle icon in DetailsPanelView
* Stop using hardcoded strings...
* Bump to rc02
* Smoother rotary scrolling
* Revert "Smoother rotary scrolling"
This reverts commit e13738983d.
* Only show loading screen in one place to make sure we always see the same ui
* Add entity state complication with hardcoded entity id
* Add config activity and save entity id in DB
* Update complications when entity state changes
* Allow all entity types for complication
* Update config layout
* remove unused file
* Upload database json
* Process review comments!
* Fix little bug
* Icon background and error catching
* Add automatic refresh and fix missed Dao inject
* Add icons for standard domains
91cd584b4b/src/common/const.ts (L66)
* Cleanup and further icon updates
* Add dagger module for daos
* Update classes in common to inject daos
* Update app view models to use inject
* Use inject with widgets
* Update app activities and fragments to use inject
* Clean up imports
* Make TileExtensions use coroutines
* Sync sensor enabled state from app to core
- Change sensor 'registered' to indicate not registered, registered as disabled or registered as enabled
- When a sensor is disabled, set it's status as such on core 2022.6 servers
- In the sensor registration, use the basic sensor details in case there is no info in the database that can be used
* Clean up version check
- Now that there is a standard function to get the version, re-use it
* Improve which sensors are synced to core
- Update database migration to reset registration state on db upgrade to make sure the information is correct for all sensors
- Only sync sensors that are actually available on the device
- Fix registering all sensors on core <2022.6 on app/core version change
- Fix unnecessary sensor updates due to location sensors which are never registered always triggering update on core >=2022.6
* Sync sensor enabled state from core to app
- After pushing app enabled changes to core, if on core 2022.6 check if the enabled state for any of the sensors is different from what is registered in the app and try to update the sensors. This is done by reading the entire config, because otherwise we wouldn't know about sensors that have been enabled and the app already updates all sensors at the same time so no need for tracking individual updates in the sensor update response.
- Restore getting config using webhooks, because only the webhook config contains information about entity enabled state
- Add support for opening a specific sensor's settings page, used for the notification when trying to enable a sensor that requires granting (additional) permissions
* Provide Compose preview for Play Store listing screens
* Update previews for onboarding
- Set theme correctly and show system UI
- Add variant for dark mode
* Update Wear OS listing image
* Remove specific icon, we can use domain default
- The touch target for the refresh button is really small and there aren't any other conflicting actions, so allow tapping anywhere to refresh the content
- Fixes the default domain icon on shortcut tiles not working because of a missing ".", used an extension function to prevent this problem in the future
* Update Kotlin to 1.6 and Compose to 1.1
- Remove @ExperimantalComposeUiApi, @ExperimentalWearMaterialApi annotations (because the functions aren't experimental, we are just using an experimental API) and replace with an opt-in declaration at the 'lowest level' usage
- Websocket: ProducerScope is no longer experimental so the annotation can be completely removed
- Wear: the animation APIs that are used for the time text are no longer experimental so the annotation can be completely removed
* Update for Compose sensor settings merge
* Add fan speed detail panel to Wear OS
- Added a fan speed slider for entities that support setting the fan speed
- Adjust light brightness string to include percentage symbol
* Rename extension function
* Add extensions to Entity for domain, lights features
- Add extension property for domain
- Add extension functions for lights: support for setting brightness and color temperature
* Use domain extension property in more places
* Add details panel with light brightness/colortemp control
* Update InlineSlider icons
* Process review comments
* Update toggle placement and string formatting
* Fix last strings and use representative color for Color temperature bar
* Websocket: make connected Job Deferred to get errors
- Switch the job used for monitoring whether a connection has been established to use Deferred, which will allow us to get the exception that caused the job to be cancelled (and also makes the code a little easier)
* Websocket: add variable for state
- Add a variable to the websocket repository to monitor the state of the connection. This will allow the app to respond to handled exceptions.
* More Websocket race condition fixes
- If multiple outgoing messages are pending before the connection is opened, if we receive an invalid auth message or onFailure callback this will be processed last. The connected job is still 'completed', so it shouldn't return true but return if it was successful. This will ensure that any messages after the first one that triggered the failure, will be ignored until the job is reset.
- Set the connection state to authenticating before sending the message, to make sure that we don't accidentally override a very quick response
* Handle error states in HomeView
- Add a state for the loading progress to the view model in order to be able to update the home view with errors if necessary
- If loading the main data failed because of authentication, reset the session like in the phone app and send the user back to onboarding
- Fix the app getting stuck on a loading screen, even if everything loaded correctly, if there are no supported entity domains in the response
* Allow toggling fans on Wear OS
* Allow toggling covers on Wear OS
* Update Wear phone settings to read supported domains
- Updates the Wear settings in the phone app to read from the app which domains are supported, and use this for filtering the list
- Add strings for cover and fan domains
* Fix shortcuts tile cover icon
* Add 'Sign in on phone' button to Wear OS login
- Detects a compatible app and shows a button to sign in on your phone instead, which is a lot easier than typing everything on the watch
* Include exception for phone sign in in log
* Initial Wear MFA support
- Added support for authentication with MFA to the Wear OS login flow
- Renamed the existing Authentication* stuff to PasswordAuthentication*
- For the authentication flow, specify a base class used for responses and depending on the response return the appropriate data class that extends the base class
* Add MFA screens
- Adjusting the existing view to add a new title and input and showing/hiding based on state created a buggy experience on the emulator where the keyboard confirm/next buttons didn't work properly any more, so the MFA input is a full new activity. Copied from the existing activity for username/password.
* Fix MFA activity tools:context
* Move MFA in to the existing AuthenticationActivity
- Actually it is possible to get the MFA input in the same activity with a little effort, but the end result works great and doesn't use as much duplicate code
* Remove MFA activity, rename PasswordAuthentication* back
- Remove the MFA activity now that MFA is integrated into the other activity for authentication
- Rename back PasswordAuthentication* to Authentication* (end result compared to existing app: no change)
* Remove unnecessary JsonIgnoreProperties annotation
* Initial implementation of template tile
Includes settings on phone and watch. Watch settings will be removed in next commit
* Add refresh interval setting to wear app
* Update wear settings layout
* Add interval setting to phone app
* ktlint
* Add example image to the manifest
* Add preview of rendered template in phone settings
* Process review comments
* Use resources for interval strings
* First area implementation for Wear
* Fix import / ktlint
* Area IDs are only nullable in core, not for clients
* A new approach to managing the entity lists
- Change the approach to getting state lists to support any number of lists per type. By nesting a state list inside the list Compose should still be able to update on any changes. To display, loop through the items.
- The main view model now filters the main/source entity list that is used everywhere by supported entities to prevent unusable domains from showing up.
- Fix padding above all entities/settings to make sure that there is still padding even if there are no entities.
- Temporary fix for favorites/tiles: hardcode the lists used. Should be updated to read items dynamically but I couldn't get the rememberSaveable to work in time.
* Filter entities in EntityListView to keep live updates
- Keep the updates in the EntityListView always live by allowing filtering the list in the view itself. Without these changes, selecting any domain from the main screen would give a static list because filtering creates a copy of the original.
- Fix ktlint import ordering
* Listen for registry updates in the main list
- Subscribe to events for registry updates and update any lists. Compose will take care of updating views if necessary, which basically makes this plug and play.
* Load entities for favorites+tiles dynamically
- Load all the entities by domain when setting favorites or tiles, instead of using hardcoded references to specific domains. This is a proper fix for the updated list structure introduced in a previous commit.
- Reuse saving the expanded states of lists from EntityListView because favorites and tiles can now also be any number of headers
* Fix 'All entities' icon filter
* Move names for supported domains
- For determining which tiles are toggleable we already access the implementation directly so remove todos and move names for those domains over to the implementation to keep everything in one place. The main view model will include a simple function to convert the string ID to an actual string.
* Order area/domain lists alphabetically
- Create a new observable list that can be used to determine the order in which to display the list or areas/entities. A mutableMapOf in Kotlin by default respects the insert order but it looks like the mutableStateMapOf doesn't follow that as the items are already inserted alphabetically.
- Allow passing in a list order for the EntityListView to prevent entities from suddenly ending up in a different place on a different screen
* Order entities in area, util object for area
- Order the list of entities displayed in one area alphabetically by their friendly name instead of domain, as it would otherwise still use domains internally to sort but not show them which is not a good experience.
- Create an util object in the common package for getting the area of an entity, as the same code was used both in the device controls and Wear main list.
* Restore domain descriptions to original (plural)
* Add a work profile sensor
The information on whether the work profile is available only seems to
be given by tracking the state of the last received broadcast intent
indication - MANAGED_PROFILE_[UN]AVAILABLE
Thus add a receiver for these intents, and slightly change the architecture
so that the intent can be passed down when the sensor needs to be updated.
I think there's a ineffciency in the architecture - currently all
sensors are asked to update whenever any broadcast the app tracks is
received, regardless of whether than broadcast is relevant to the the
sensor or now - for example all sensors update when battery state changes.
* Revert typo fix to keep this PR focused.
* Pass lint checks