Commit Graph

326 Commits

Author SHA1 Message Date
dependabot[bot]
55fff2b87f
Bump com.google.dagger:hilt-android-compiler from 2.44.2 to 2.45 (#3330)
Bumps [com.google.dagger:hilt-android-compiler](https://github.com/google/dagger) from 2.44.2 to 2.45.
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.44.2...dagger-2.45)

---
updated-dependencies:
- dependency-name: com.google.dagger:hilt-android-compiler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-14 20:35:38 -05:00
Daniel Shokouhi
8bede17fd6
Show version number in Wear OS settings (#3327) 2023-02-14 20:33:03 -05:00
Joris Pelgröm
f7cec0e5a2
Multiserver (#3332)
* 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
2023-02-14 20:30:06 -05:00
Daniel Shokouhi
047abe93ba
Add new option to only show favorites on home screen (#3276)
* Add new option to only show favorites on home screen

* Review comments

* Review comments
2023-02-01 12:04:24 -05:00
Daniel Shokouhi
152d11147a
Add a watchface complication for Assist (#3284) 2023-01-31 14:56:03 -05:00
Daniel Shokouhi
60f76fcd45
Add TTS notifications to Wear OS (#3266) 2023-01-31 14:18:58 -05:00
Daniel Shokouhi
00588d0270
Only show not supported error after support check is complete and design tweaks (#3270)
* Only show not supported error after support check is complete

* Minor design tweaks
2023-01-26 18:01:06 -05:00
dependabot[bot]
cfc07362e8
Bump jackson-module-kotlin from 2.13.4 to 2.13.5 (#3256)
Bumps [jackson-module-kotlin](https://github.com/FasterXML/jackson-module-kotlin) from 2.13.4 to 2.13.5.
- [Release notes](https://github.com/FasterXML/jackson-module-kotlin/releases)
- [Commits](https://github.com/FasterXML/jackson-module-kotlin/compare/jackson-module-kotlin-2.13.4...jackson-module-kotlin-2.13.5)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.module:jackson-module-kotlin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-25 20:32:51 -05:00
Daniel Shokouhi
6be617e666
Add ble transmitter and beacon monitor notification commands to Wear OS (#3253)
* Add ble transmitter and beacon monitor commands to Wear OS

* Move log to command check failure
2023-01-25 20:32:32 -05:00
Daniel Shokouhi
65696e891b
Make conversation activity launchable (#3254)
* Make conversation activity launchable

* Use better launcher icons per review comments

* Review comments
2023-01-24 22:27:04 -05:00
Joris Pelgröm
9e8e37a5c2
Fix conversation tile vibrate after settings split (#3246) 2023-01-20 19:59:53 +00:00
Joris Pelgröm
a4fd7d4fd8
Set Wear OAuth redirect URI automatically and catch exceptions (#3244)
- 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
2023-01-20 14:11:01 -05:00
Joris Pelgröm
e382a4b687
Split app-level and server-level settings (#3241)
* 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
2023-01-20 14:10:21 -05:00
Daniel Shokouhi
ca8059da65
Add bluetooth skippable intents in case sensor is not enabled (#3240) 2023-01-20 14:05:10 -05:00
Daniel Shokouhi
cce8b60c66
Conversation tile design changes (#3233)
* 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
2023-01-20 14:03:30 -05:00
Daniel Shokouhi
346ef3da5f
Initial commit of notification support on Wear OS (#3221)
* 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
2023-01-20 14:02:03 -05:00
Justin Bassett
220b73d20f
Bump a bunch of dependencies. (#3216) 2023-01-13 11:18:54 -05:00
Daniel Shokouhi
a5cbe04315
Update conversation tile text and icon (#3209)
* Update conversation tile text and icon

* Minor design tweaks: increase corner radius, push down icon

* Update per review comment
2023-01-12 16:05:07 -05:00
Justin Bassett
d1e0f29486
Fix Build/Deploy 2023-01-11 22:44:30 -05:00
Daniel Shokouhi
f3360b1b92
Update health services dependency (#3212) 2023-01-11 22:04:19 -05:00
Daniel Shokouhi
527325f153
Add missing phone permission to Wear manifest (#3200) 2023-01-11 16:38:25 -05:00
Daniel Shokouhi
db63a38cd5
Migrate bluetooth sensors to common and add to wear OS (#3168)
* Migrate bluetooth sensors to common and add to wear OS

* Add missing BT permissions and register for state change events

* Update permissions again
2023-01-11 16:37:00 -05:00
Joris Pelgröm
7e5e3adfe9
Use entity icon for quick settings tiles by default (#3160)
- When creating a new quick setting tile, use the entity's icon by default
 - Move Wear icon based on entity domain code to common
2022-12-18 15:31:01 -05:00
Daniel Shokouhi
7f32738e10
Add a tile to start a conversation (#3158)
* 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
2022-12-18 15:25:00 -05:00
Daniel Shokouhi
8df504e1d7
Migrate more sensors to Wear OS (#3115) 2022-12-18 15:20:12 -05:00
Daniel Shokouhi
5780f1492b
Restart health services if no updates received in 30 minutes (#3126)
* Restart health services if no updates received in 30 minutes

* Only update activity state if the state changes or an update needs to be forced
2022-12-16 09:59:29 -05:00
Daniel Shokouhi
49849d4587
Let heart rate sensor get up to 10 events in case first is invalid (#3125)
* Let heart rate sensor get up to 5 events in case first is invalid

* Increase to 10 events to try and get a reading
2022-12-16 09:58:28 -05:00
Daniel Shokouhi
d5714d85e4
Only subscribe to supported entities on Wear OS home screen (#3103)
* 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
2022-11-30 14:59:57 -05:00
Daniel Shokouhi
8563efef5f
Add some debug logs for heart rate sensor (#3111) 2022-11-28 22:15:36 -05:00
Joris Pelgröm
442cb25e59
Add deeplinks to Wear OS sensor sync notifications (#3105)
Add deeplinks to Wear sensor sync notifications
2022-11-28 22:11:57 -05:00
Daniel Shokouhi
fd7a593c41
Fix current version sensor so it properly reports the flavor (#3104)
* Fix current version sensor so it properly reports the flavor

* Review comments
2022-11-28 22:11:12 -05:00
Daniel Shokouhi
f15b192a79
Reduce usage of job scheduling to avoid throttling (#3087) 2022-11-22 14:04:55 -05:00
Daniel Shokouhi
382b26c4c3
Skip heart rate value updates when below 0 (#3081) 2022-11-22 13:59:58 -05:00
Daniel Shokouhi
5a38f95482
Add proper device class for daily distance sensor on Wear OS3 (#3079)
* Add proper device class for daily distance sensor on Wear OS3

* Only use the device class distance when supported
2022-11-22 13:57:21 -05:00
dependabot[bot]
62ebb90f2e
Bump hilt-android from 2.44 to 2.44.2 (#3071)
Bumps [hilt-android](https://github.com/google/dagger) from 2.44 to 2.44.2.
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.44...dagger-2.44.2)

---
updated-dependencies:
- dependency-name: com.google.dagger:hilt-android
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-17 14:42:31 +00:00
dependabot[bot]
1b5ab1c2ec
Bump hilt-android-compiler from 2.44 to 2.44.2 (#3072)
Bumps [hilt-android-compiler](https://github.com/google/dagger) from 2.44 to 2.44.2.
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.44...dagger-2.44.2)

---
updated-dependencies:
- dependency-name: com.google.dagger:hilt-android-compiler
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-17 09:30:21 -05:00
Daniel Shokouhi
a390865cad
Store health services updates and send them with worker updates (#3076)
* Store health services updates and send them with worker updates

* Switch update type to worker
2022-11-17 09:06:56 -05:00
Joris Pelgröm
0bccff65c3
Revert jackson-module-kotlin bump to fix compatibility on older Android version (#3077) 2022-11-17 09:06:31 -05:00
Daniel Shokouhi
494414eb87
Add Daily Calories, Distance and Steps sensors for health services (#3054)
* Add Daily Calories, Distance and Steps sensors for health services

* Process data points before condition to push update
2022-11-12 08:24:17 -05:00
Daniel Shokouhi
33d1e30cb1
Switch from viewModelScope to lifecycleScope for external collections (#3045)
* 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
2022-11-12 08:23:44 -05:00
dependabot[bot]
a20fb24ddc
Bump jackson-module-kotlin from 2.13.4 to 2.14.0 (#3048)
Bumps [jackson-module-kotlin](https://github.com/FasterXML/jackson-module-kotlin) from 2.13.4 to 2.14.0.
- [Release notes](https://github.com/FasterXML/jackson-module-kotlin/releases)
- [Commits](https://github.com/FasterXML/jackson-module-kotlin/compare/jackson-module-kotlin-2.13.4...jackson-module-kotlin-2.14.0)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.module:jackson-module-kotlin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-09 16:18:05 -05:00
Daniel Shokouhi
afa8a83496
Add missing boot completed permission for Wear OS (#3042) 2022-11-09 16:15:26 -05:00
Daniel Shokouhi
6f2b5cf9eb
Remove unneeded kotlin option (#3039) 2022-11-09 16:15:08 -05:00
Daniel Shokouhi
57b3b771b4
Track time between hardware sensor updates to restart the listener as needed (#3026)
* Check if listener got stuck for heart rate sensor and restart if needed

* Apply reset listener logic to other hardware sensors

* Review comments
2022-11-09 16:14:49 -05:00
Daniel Shokouhi
affc60178e
Add daily floors sensor for Wear OS3 devices (#3005)
* 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
2022-11-09 16:12:13 -05:00
Mads Sørensen
e01246ae28
Add caching of favorites in Wear OS, resulting in prettier loading (#2982)
* 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>
2022-11-09 16:06:38 -05:00
Daniel Shokouhi
c89184bf31
Bump and switch to compose BOM dependency (#3028)
* Bump and switch to compose BOM dependency

* Bump kotlin and compose extensions
2022-11-03 12:31:35 -04:00
Jorden
1b1c2bb672
Change DocsLink in Wear OS Sensors (#3017) 2022-11-03 12:27:38 -04:00
Daniel Shokouhi
7f5dd17c87
Add a heart rate sensor to Wear OS (#3008) 2022-10-28 13:34:05 -04:00
StopMotionCuber
11f2006924
Set focus for onboarding activity to support rotary input (#3009) 2022-10-28 13:21:17 -04:00
Tiger Oakes
3f9b01affa
Remove unused setters (#3002) 2022-10-28 13:20:29 -04:00
Jorden
209497e0a2
Fix global vars in bedtime and theater mode (#3001) 2022-10-26 11:32:53 -04:00
Daniel Shokouhi
2a56db4a17
Add user activity sensor from health services for Wear OS (#2995)
* 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
2022-10-25 21:31:28 +00:00
Jorden
1faf03a490
Add Wet Mode Sensor (#2994)
* Add Wet Mode Sensor

* Add Wet Mode Sensor

* Change Description

* Fix spelling

* Fix Sloppy mistakes
2022-10-25 17:12:28 -04:00
Daniel Shokouhi
6da455f1be
Add previews to Wear OS compose and sort sensor by name (#2984)
* Add composable previews for a few missing functions

* Sort sensors by name

* Review comment

* Specify the device for Wear OS previews
2022-10-25 17:08:06 -04:00
Tiger Oakes
993012f9dd
Convert Play tasks to coroutines (#2962)
* Convert tasks to coroutines

* Fix lint issues

* fullImplementation
2022-10-25 17:07:19 -04:00
Daniel Shokouhi
c95725f767
Add more Wear OS sensors (#2981)
* Add more Wear OS sensors

* Update description for how sensors update, also update the type
2022-10-21 18:19:41 +00:00
dependabot[bot]
bd26435eb8
Bump community-material-typeface from 6.4.95.0-kotlin to 7.0.96.0-kotlin (#2944)
* Bump community-material-typeface from 6.4.95.0-kotlin to 7.0.96.0-kotlin

Bumps [community-material-typeface](https://github.com/mikepenz/Android-Iconics) from 6.4.95.0-kotlin to 7.0.96.0-kotlin.
- [Release notes](https://github.com/mikepenz/Android-Iconics/releases)
- [Changelog](https://github.com/mikepenz/Android-Iconics/blob/develop/gradle-release.gradle)
- [Commits](https://github.com/mikepenz/Android-Iconics/commits)

---
updated-dependencies:
- dependency-name: com.mikepenz:community-material-typeface
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Rename text-to-speech to microphone-message

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>
Co-authored-by: Justin Bassett <bassett.justint@gmail.com>
2022-10-21 17:57:15 +00:00
dependabot[bot]
fa095a8bb2
Bump iconics-core from 5.3.4 to 5.4.0 (#2945)
Bumps [iconics-core](https://github.com/mikepenz/Android-Iconics) from 5.3.4 to 5.4.0.
- [Release notes](https://github.com/mikepenz/Android-Iconics/releases)
- [Changelog](https://github.com/mikepenz/Android-Iconics/blob/develop/gradle-release.gradle)
- [Commits](https://github.com/mikepenz/Android-Iconics/compare/v5.3.4...v5.4.0)

---
updated-dependencies:
- dependency-name: com.mikepenz:iconics-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-21 17:56:36 +00:00
Daniel Shokouhi
e8fe823312
Add On Body sensor for Wear OS (#2961)
* Add On Body sensor for Wear OS

* Remove unnecessary requirement
2022-10-21 13:47:20 -04:00
dependabot[bot]
1d3e8d67e9
Bump iconics-compose from 5.3.4 to 5.4.0 (#2943)
Bumps [iconics-compose](https://github.com/mikepenz/Android-Iconics) from 5.3.4 to 5.4.0.
- [Release notes](https://github.com/mikepenz/Android-Iconics/releases)
- [Changelog](https://github.com/mikepenz/Android-Iconics/blob/develop/gradle-release.gradle)
- [Commits](https://github.com/mikepenz/Android-Iconics/compare/v5.3.4...v5.4.0)

---
updated-dependencies:
- dependency-name: com.mikepenz:iconics-compose
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-21 13:42:10 -04:00
Joris Pelgröm
e287321c53
Show settings chip while loading Wear app (#2968)
* Show settings chip while loading Wear app

* Disable favorite editing while loading
2022-10-19 14:54:09 -04:00
Daniel Shokouhi
7c792c4d4b
Add permissions requests to wear OS sensors and add network sensors (#2956)
* 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
2022-10-19 14:48:35 -04:00
Joris Pelgröm
4a9dd8ba04
Android 13 notification changes + target (#2682)
* 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
2022-10-19 14:43:15 -04:00
Justin Bassett
1adc33bf61
Bump Hilt version to 2.44 (#2939)
Bump hilt version to 2.44
2022-10-01 17:12:32 -04:00
Joris Pelgröm
abf0220430
Update Gradle to 7.5.1, Android Gradle plugin to 7.3.0 (#2934)
- 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
2022-10-01 16:14:45 -04:00
Joris Pelgröm
0222d6b673
Bump Google dependencies (#2910) 2022-09-24 16:04:58 -04:00
Daniel Shokouhi
7ab914a8bb
Mark Wear OS app as non-standalone since we use phone for sign in now (#2900) 2022-09-21 00:40:48 +00:00
Joris Pelgröm
69beab3a2a
Don't collapse lists by default if there's only one list (#2861)
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
2022-09-10 15:17:10 -04:00
dependabot[bot]
2380741a45
Bump jackson-module-kotlin from 2.13.3 to 2.13.4 (#2851)
Bumps [jackson-module-kotlin](https://github.com/FasterXML/jackson-module-kotlin) from 2.13.3 to 2.13.4.
- [Release notes](https://github.com/FasterXML/jackson-module-kotlin/releases)
- [Commits](https://github.com/FasterXML/jackson-module-kotlin/compare/jackson-module-kotlin-2.13.3...jackson-module-kotlin-2.13.4)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.module:jackson-module-kotlin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-05 14:42:26 +00:00
Joris Pelgröm
a711c659a4
Update Wear onboarding to always use phone for sign in (#2838)
* 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
2022-09-05 10:25:13 -04:00
Joris Pelgröm
c6b36d82bb
Support device controls on locked Android 13 device (#2820)
- Add support for using device controls while the device is locked on Android 13 devices
 - Start compiling with Android 13's SDK to make this possible
2022-09-05 09:58:13 -04:00
Joris Pelgröm
3908a07c1f
Prevent crashes on Wear when offline / server no longer available (#2825)
- 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
2022-08-29 20:53:52 -04:00
Wouter van der Wal
0148c65284
Calculate fan speed step count (#2818)
* Calculate fan speed step count

* Fix linting issues

* Fixed wrong function name in log text

Co-authored-by: Joris Pelgröm <jpelgrom@users.noreply.github.com>

Co-authored-by: Joris Pelgröm <jpelgrom@users.noreply.github.com>
2022-08-29 20:27:02 -04:00
leroyboerefijn
d00c823651
Faster entity selection Wear OS (#2804)
* Always collapse headers and add favorites section

* Remove unneeded entity update subscription

* Process comments

* Use shorthand for favorites loop in MainView
2022-08-29 20:24:35 -04:00
Daniel Shokouhi
7f5ec402db
Bump some more app dependencies (#2792) 2022-08-13 20:52:34 -04:00
dependabot[bot]
ca6c0c505f
Bump hilt-android from 2.42 to 2.43.2 (#2754)
Bumps [hilt-android](https://github.com/google/dagger) from 2.42 to 2.43.2.
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.42...dagger-2.43.2)

---
updated-dependencies:
- dependency-name: com.google.dagger:hilt-android
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-04 22:59:49 +00:00
dependabot[bot]
c45618b355
Bump hilt-android-compiler from 2.42 to 2.43.2 (#2755)
Bumps [hilt-android-compiler](https://github.com/google/dagger) from 2.42 to 2.43.2.
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.42...dagger-2.43.2)

---
updated-dependencies:
- dependency-name: com.google.dagger:hilt-android-compiler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-04 18:24:00 -04:00
Daniel Shokouhi
d68666dae0
Bump some app dependencies (#2751)
* Bump some phone app dependencies

* Add wear dependencies

* Bump compile SDK in common
2022-08-03 18:03:14 -04:00
Joris Pelgröm
bddb3a62dd
Don't include session in backup/transfer (#2747)
- The session data is unique to the device and shouldn't be included in a backup or transfer
 - Add Android 12+ backup rules for Wear OS
2022-08-03 18:02:31 -04:00
Joris Pelgröm
9fc98e464e
Remove error message on null template (#2735)
* 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
2022-08-03 17:59:00 -04:00
leroyboerefijn
e7a926396d
Implement html styling on the template tile (#2653)
* 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>
2022-07-29 17:42:17 -04:00
dependabot[bot]
41f6045557
Bump kotlinx-coroutines-android from 1.6.3 to 1.6.4 (#2678)
Bumps [kotlinx-coroutines-android](https://github.com/Kotlin/kotlinx.coroutines) from 1.6.3 to 1.6.4.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.3...1.6.4)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-android
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-17 03:32:15 +00:00
dependabot[bot]
b13f548aea
Bump kotlinx-coroutines-guava from 1.6.3 to 1.6.4 (#2679)
Bumps [kotlinx-coroutines-guava](https://github.com/Kotlin/kotlinx.coroutines) from 1.6.3 to 1.6.4.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.3...1.6.4)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-guava
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-16 23:25:27 -04:00
Joris Pelgröm
7b401abddc
Don't complete onboarding on registration error (#2646)
- 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
2022-06-30 21:58:24 -04:00
Joris Pelgröm
aa256676c4
Show entity state on chip background (#2634)
* 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
2022-06-30 21:56:38 -04:00
dependabot[bot]
a9de8e3f72
Bump iconics-compose from 5.3.3 to 5.3.4 (#2643)
Bumps [iconics-compose](https://github.com/mikepenz/Android-Iconics) from 5.3.3 to 5.3.4.
- [Release notes](https://github.com/mikepenz/Android-Iconics/releases)
- [Changelog](https://github.com/mikepenz/Android-Iconics/blob/develop/gradle-release.gradle)
- [Commits](https://github.com/mikepenz/Android-Iconics/compare/v5.3.3...v5.3.4)

---
updated-dependencies:
- dependency-name: com.mikepenz:iconics-compose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-26 15:41:23 -04:00
dependabot[bot]
1efc605c42
Bump kotlinx-coroutines-android from 1.6.2 to 1.6.3 (#2642)
Bumps [kotlinx-coroutines-android](https://github.com/Kotlin/kotlinx.coroutines) from 1.6.2 to 1.6.3.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.2...1.6.3)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-android
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-26 15:41:08 -04:00
dependabot[bot]
9c2c2ae4ae
Bump kotlinx-coroutines-guava from 1.6.2 to 1.6.3 (#2639)
Bumps [kotlinx-coroutines-guava](https://github.com/Kotlin/kotlinx.coroutines) from 1.6.2 to 1.6.3.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.2...1.6.3)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-guava
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-26 18:36:44 +00:00
dependabot[bot]
1a9a8adfb5
Bump iconics-core from 5.3.3 to 5.3.4 (#2640)
Bumps [iconics-core](https://github.com/mikepenz/Android-Iconics) from 5.3.3 to 5.3.4.
- [Release notes](https://github.com/mikepenz/Android-Iconics/releases)
- [Changelog](https://github.com/mikepenz/Android-Iconics/blob/develop/gradle-release.gradle)
- [Commits](https://github.com/mikepenz/Android-Iconics/compare/v5.3.3...v5.3.4)

---
updated-dependencies:
- dependency-name: com.mikepenz:iconics-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-26 18:33:12 +00:00
Joris Pelgröm
71b1fe1a00
Speed up device controls/Wear OS loading by doing network async (#2636)
* 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
2022-06-26 14:19:24 -04:00
leroyboerefijn
b261fe1fdf
Bump wear compose to 1.0.0-rc02 (#2633)
* 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
2022-06-26 14:16:06 -04:00
leroyboerefijn
50d387a726
Entity state complication (#2574)
* 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
2022-06-20 20:24:37 -04:00
dependabot[bot]
e8fd1760f4
Bump okhttp from 4.9.3 to 4.10.0 (#2608)
Bumps [okhttp](https://github.com/square/okhttp) from 4.9.3 to 4.10.0.
- [Release notes](https://github.com/square/okhttp/releases)
- [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/okhttp/compare/parent-4.9.3...parent-4.10.0)

---
updated-dependencies:
- dependency-name: com.squareup.okhttp3:okhttp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-14 13:52:56 +00:00
Joris Pelgröm
f8a3584054
Remove specific jackson-databind dependency (#2567) 2022-06-01 11:34:38 -04:00
dependabot[bot]
31ab4e822c
Bump jackson-module-kotlin from 2.13.2 to 2.13.3 (#2562)
Bumps [jackson-module-kotlin](https://github.com/FasterXML/jackson-module-kotlin) from 2.13.2 to 2.13.3.
- [Release notes](https://github.com/FasterXML/jackson-module-kotlin/releases)
- [Commits](https://github.com/FasterXML/jackson-module-kotlin/compare/jackson-module-kotlin-2.13.2...jackson-module-kotlin-2.13.3)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.module:jackson-module-kotlin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-30 20:42:39 +00:00
dependabot[bot]
d62ae99b20
Bump kotlinx-coroutines-guava from 1.6.1 to 1.6.2 (#2560)
Bumps [kotlinx-coroutines-guava](https://github.com/Kotlin/kotlinx.coroutines) from 1.6.1 to 1.6.2.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.1...1.6.2)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-guava
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-30 20:19:14 +00:00
dependabot[bot]
0ef230a29c
Bump jackson-databind from 2.13.2.2 to 2.13.3 (#2561)
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.2.2 to 2.13.3.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-30 20:18:38 +00:00
dependabot[bot]
78150f4fe0
Bump kotlinx-coroutines-android from 1.6.1 to 1.6.2 (#2559)
Bumps [kotlinx-coroutines-android](https://github.com/Kotlin/kotlinx.coroutines) from 1.6.1 to 1.6.2.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.1...1.6.2)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-android
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-30 20:07:31 +00:00
Justin Bassett
11868c185c
Dependency bumps. (#2556) 2022-05-30 15:40:54 -04:00
Tiger Oakes
f4375e4b72
Add dagger module for daos (#2541)
* 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
2022-05-30 14:04:26 -04:00
Joris Pelgröm
c98b291d30
Sync sensor enabled state with core 2022.6+ (#2547)
* 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
2022-05-29 11:22:52 -04:00
Tiger Oakes
c532b74a94
Update compose items loops to use keys (#2544) 2022-05-29 10:32:20 -04:00
Joris Pelgröm
a06f96fd4d
Provide Compose preview for Play Store listing screens (#2542)
* 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
2022-05-23 17:13:31 -04:00
Joris Pelgröm
f81989f78e
Hide hidden entities on Wear home screen (#2509) 2022-05-08 13:15:26 -04:00
Joris Pelgröm
1f95e6af87
Allow refreshing Wear template tile by tapping anywhere (#2508)
- 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
2022-05-08 13:13:28 -04:00
Joris Pelgröm
f33743dc14
Fix crash on start app on SDK <26 (#2497)
- Manually specify databind version to fix https://github.com/FasterXML/jackson-databind/issues/3412, as the Kotlin module still depends on the unfixed version and hasn't had a new release yet
2022-05-01 14:32:00 -04:00
dependabot[bot]
ec6ae4345c
Bump kotlin-stdlib-jdk8 from 1.6.20 to 1.6.21 (#2467)
Bumps [kotlin-stdlib-jdk8](https://github.com/JetBrains/kotlin) from 1.6.20 to 1.6.21.
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib-jdk8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-23 07:34:05 -04:00
Joris Pelgröm
fc8e961ef1
Add haptic + toast feedback to Wear OS details screen (#2455) 2022-04-23 07:16:21 -04:00
Tiger Oakes
3309c59bfd
Move SensorDao operations to Transactions (#2447)
* Add setSensorsEnabled helper

* Update SensorDetailViewModel

* Update sensormanager
2022-04-23 07:10:51 -04:00
dependabot[bot]
9ed331f9e7
Bump kotlinx-coroutines-android from 1.6.0 to 1.6.1 (#2451)
Bumps [kotlinx-coroutines-android](https://github.com/Kotlin/kotlinx.coroutines) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.0...1.6.1)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-android
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-12 19:18:05 -04:00
dependabot[bot]
536139ab5e
Bump kotlin-stdlib-jdk8 from 1.6.10 to 1.6.20 (#2427)
Bumps [kotlin-stdlib-jdk8](https://github.com/JetBrains/kotlin) from 1.6.10 to 1.6.20.
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v1.6.20/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v1.6.10...v1.6.20)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib-jdk8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-12 19:16:41 -04:00
dependabot[bot]
c14eb2d7c9
Bump kotlinx-coroutines-guava from 1.6.0 to 1.6.1 (#2431)
Bumps [kotlinx-coroutines-guava](https://github.com/Kotlin/kotlinx.coroutines) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.0...1.6.1)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-guava
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-12 18:48:45 -04:00
Tiger Oakes
6c64b31f7e
Use collectAsState for SensorDao.getAllFlow (#2423) 2022-04-06 17:52:21 -04:00
Tiger Oakes
dbb1e8bf5d
Use suspend and transactions for Favorites dao (#2398) 2022-03-25 12:56:18 -04:00
Joris Pelgröm
81831a978e
Fix Wear default domain icon on shortcut tile (#2404)
- 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
2022-03-25 12:51:58 -04:00
Joris Pelgröm
965ee61b11
Don't crash on sensor update on on/off/setting change (#2391)
* Don't crash on sensor update on on/off/setting change

* Update logging message, also for Wear OS
2022-03-22 20:17:17 -04:00
dependabot[bot]
e29dc0b66f
Bump jackson-module-kotlin from 2.13.1 to 2.13.2 (#2379)
Bumps [jackson-module-kotlin](https://github.com/FasterXML/jackson-module-kotlin) from 2.13.1 to 2.13.2.
- [Release notes](https://github.com/FasterXML/jackson-module-kotlin/releases)
- [Commits](https://github.com/FasterXML/jackson-module-kotlin/compare/jackson-module-kotlin-2.13.1...jackson-module-kotlin-2.13.2)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.module:jackson-module-kotlin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-19 12:24:48 -04:00
Joris Pelgröm
b26928bbea
Update Kotlin to 1.6 and Compose to 1.1 (#2372)
* 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
2022-03-15 10:15:14 -04:00
leroyboerefijn
261ae31fed
Add haptic feedback to templite tile refresh (#2349) 2022-03-07 21:59:17 -05:00
dependabot[bot]
ac5642a482
Bump guava from 31.0.1-android to 31.1-android (#2329)
Bumps [guava](https://github.com/google/guava) from 31.0.1-android to 31.1-android.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/commits)

---
updated-dependencies:
- dependency-name: com.google.guava:guava
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-03 18:56:43 -05:00
Joris Pelgröm
27b02a0be5
Add fan speed to Wear OS detail panel (#2332)
* 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
2022-03-03 18:55:16 -05:00
Joris Pelgröm
72a598fdbe
Add extensions to Entity for domain, lights features (#2322)
* 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
2022-02-26 17:34:29 -05:00
leroyboerefijn
9c5ced9963
Wear detail panel (#2288)
* 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
2022-02-23 08:04:43 -05:00
dependabot[bot]
7e3d5aa10d
Bump hilt-android-compiler from 2.40.5 to 2.41 (#2295)
Bumps [hilt-android-compiler](https://github.com/google/dagger) from 2.40.5 to 2.41.
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.40.5...dagger-2.41)

---
updated-dependencies:
- dependency-name: com.google.dagger:hilt-android-compiler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-19 14:03:01 -05:00
dependabot[bot]
8af88297c1
Bump hilt-android from 2.40.5 to 2.41 (#2293)
Bumps [hilt-android](https://github.com/google/dagger) from 2.40.5 to 2.41.
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.40.5...dagger-2.41)

---
updated-dependencies:
- dependency-name: com.google.dagger:hilt-android
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-19 13:49:40 -05:00
Joris Pelgröm
83bdcfd245
Improve Wear OS error handling on home, check websocket connection state (#2261)
* 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
2022-02-19 13:48:07 -05:00
Daniel Shokouhi
074c8aea43
Clean up old quest flavor code and hide some features from unsupported devices (#2265)
* Clean up old quest flavor code and hide some features from unsupported devices

* Check if device supports telephony for phone sesnors
2022-02-16 23:04:38 -05:00
Joris Pelgröm
4544c3473b
Wear use state and device class for entity icons (#2289)
* Use the same function to get icons everywhere

* Use state to determine entity icon
2022-02-16 22:45:24 -05:00
Timothy Kist
e21d095195
Wear OS sensors UI (#2033) 2022-02-16 20:43:23 -05:00
Joris Pelgröm
e7ebcff870
Support pressing (input_)buttons on Wear OS (#2229)
* Support button domain on Wear OS

* Support input_button domain on Wear OS
2022-02-02 21:12:13 -05:00
Joris Pelgröm
d2e944023e
Hide non-primary entities on Wear home screen (#2216) 2022-01-31 14:58:01 -05:00
Joris Pelgröm
9a753918c9
Allow toggling covers and fans on Wear OS (#2215)
* 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
2022-01-30 15:05:55 -05:00
Joris Pelgröm
2c55a3fd05
Bump and fix Android Gradle Plugin from 7.0.4 to 7.1.0 (#2203) 2022-01-26 21:07:55 -05:00
Daniel Shokouhi
b7f6a7322c
Bump app dependencies and fix wear rotary input (#2184)
* Bump app dependencies

* Rotary input fixes and improvement
2022-01-22 15:19:19 -05:00
Tiger Oakes
6bc0512064
Add helpers for duplicate Wear Compose code (#2175)
* Add ExpandableListHeader, rememberExpandedStates

* Add helper for ScalingLazyColumn

* Add helper for Chip in Settings

* Swap if statement
2022-01-21 21:06:20 -05:00
SkechyWolf
817af69069
Update Compose And Remove BackHandler (#2160) 2022-01-18 21:18:40 -05:00
Joris Pelgröm
e1e12dc2a2
Add 'Sign in on phone' button to Wear OS login (#2154)
* 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
2022-01-18 16:40:17 -05:00
Joris Pelgröm
3e45d43ce0
Fix template tile refresh interval (#2151)
- The saved value is already in seconds, so there is no need to multiply it by 60
2022-01-17 20:14:29 -05:00
leroyboerefijn
131296ad01
Show names on shortcuts tile (#2142)
* Show names on shortcuts tile

* Reorganize shortcuts tile settings
2022-01-17 20:11:47 -05:00
Tiger Oakes
26f700bab2
Use getSystemService extension from Core KTX (#2136)
* Use getSystemService extension from Core KTX

* Replace deprecated bluetooth calls
2022-01-17 20:08:23 -05:00
Joris Pelgröm
050d449ef2
Support MFA during Wear OS standalone login (#2131)
* 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
2022-01-17 20:01:57 -05:00
leroyboerefijn
3a15c0fb33
Template tile for wear OS (#2122)
* 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
2022-01-13 15:04:10 -05:00
Joris Pelgröm
4796284169
Add areas to entity list on Wear (#2118)
* 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)
2022-01-11 21:26:12 -05:00
zmarties
43b53923ab
Add a work profile sensor (#2026)
* 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
2021-12-31 07:53:07 -05:00
Daniel Shokouhi
02e4efeb9f
Catch the failure on devices without rotary input (#2092) 2021-12-31 07:41:34 -05:00
Justin Bassett
476bd8984a
Work on error handling from Websocket. (#2091)
* Work on error handling from Websocket.

* Fix wear build.
2021-12-30 15:55:35 -05:00
SkechyWolf
99a7ca1e56
Exit app when back is pressed on Screen_Landing (#2077)
* Exit app when back is pressed on Sreen_Landing

* Fix imports
2021-12-26 20:55:36 -05:00
dependabot[bot]
0f984e8b83
Bump kotlinx-coroutines-guava from 1.5.2 to 1.6.0 (#2071)
Bumps [kotlinx-coroutines-guava](https://github.com/Kotlin/kotlinx.coroutines) from 1.5.2 to 1.6.0.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.5.2...1.6.0)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-guava
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-24 07:23:09 -05:00
dependabot[bot]
60d2cc140e
Bump kotlinx-coroutines-android from 1.5.2 to 1.6.0 (#2063)
Bumps [kotlinx-coroutines-android](https://github.com/Kotlin/kotlinx.coroutines) from 1.5.2 to 1.6.0.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.5.2...1.6.0)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-android
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-24 07:21:36 -05:00