Commit Graph

343 Commits

Author SHA1 Message Date
dependabot[bot]
9bb9513f9f
Bump kotlin from 1.9.24 to 2.0.0 (#4414)
* ---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-reflect
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: org.jetbrains.kotlin.android
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: org.jetbrains.kotlin.kapt
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: org.jetbrains.kotlin.plugin.parcelize
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* Bump ksp

* Use Jetbrains Compose compiler

* Remove deprecated duplicate config

* ktlint

* Remove old Compose compiler version

---------

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>
2024-06-03 08:22:03 -07:00
Joris Pelgröm
dff1fa352f
Use ksp instead of kapt for Hilt (#4418) 2024-06-02 14:39:05 +02:00
Joris Pelgröm
9935ad45e4
Trim Assist pipeline text messages (#4433)
- For received Assist pipeline text messages from the server, trim what is displayed in the app to avoid messages with additional empty lines as seen in the latest HA core beta
2024-06-01 23:08:50 +02:00
Daniel Shokouhi
d640b9d974
Use device class enum where possible and supply possible states for those sensors (#4394)
* Use device class enum where possible and supply possible states for those sensors

* Add some missing sensors

* Review comments and suppress lint

* Add media session sensor to enum device class
2024-05-13 12:41:18 -07:00
dependabot[bot]
a8f924d4b9
Bump activity-compose from 1.8.2 to 1.9.0 (#4376)
* Bump activity-compose from 1.8.2 to 1.9.0

Bumps `activity-compose` from 1.8.2 to 1.9.0.

Updates `androidx.activity:activity-compose` from 1.8.2 to 1.9.0

Updates `androidx.activity:activity-ktx` from 1.8.2 to 1.9.0

---
updated-dependencies:
- dependency-name: androidx.activity:activity-compose
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: androidx.activity:activity-ktx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Update nullability for overrides in app

* Update nullability for overrides in wear

---------

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>
2024-05-03 17:57:14 +02:00
Michael Vieck
cda6b01589
Added Compose Previews for NFC, Onboarding & Companion Views (#4239)
* Feature/compose previews (#1)

* Compose Preview created for ChooseEntityView

* Nfc view previews added

* Added onboarding previews

* Fixed ktlint errors

* Author Test

---------

* Using phone view for preview

* Using premade preview entities

* Renamed preview logs

* Review comments

---------

Co-authored-by: Joris Pelgröm <joris.pelgrom@gmail.com>
2024-04-30 17:55:05 +00:00
Daniel Shokouhi
4d9498c02b
Add some missing states for audio sensor and correct mic muted intent condition (#4350)
* Add some missing states for audio sensor

* Correct improper SDK check for mic muted intent action

* Update wear intent receivers

* Correct mic muted sensor update type
2024-04-20 15:44:04 +02:00
dependabot[bot]
15b1518a44
Bump org.jlleitschuh.gradle.ktlint from 11.6.1 to 12.1.0 (#4125)
* Bump org.jlleitschuh.gradle.ktlint from 11.6.1 to 12.1.0

Bumps org.jlleitschuh.gradle.ktlint from 11.6.1 to 12.1.0.

---
updated-dependencies:
- dependency-name: org.jlleitschuh.gradle.ktlint
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* Add .editorconfig

* ktlintFormat

* Fix comment in a 'value_argument_list' is only allowed when placed on a separate line

* Restore AssistShortcutView

* Fix comment in a 'value_argument_list' is only allowed when placed on a separate line

* Fix no comment expected at this location

* Fix property name should start with a lowercase letter and use camel case

* Fix parameter comments

* Fix comment in a 'value_argument_list' is only allowed when placed on a separate line, again

* Fix property name should use the screaming snake case notation when the value can not be changed

* Fix final comment in argument list

---------

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>
2024-02-06 21:02:39 -05:00
Joris Pelgröm
98f3d7abd2
Add option to update camera & template tile when 'in view' (#4185)
* Add option to update camera & template tile 'on view'

 - Use the tile enter callback to request an update to the tile once it enters the view. Considering that this callback exists it's probably safe to assume an update that is requested in this callback won't be throttled (at least it appears to work during testing).
 - Minor edit to the refresh interval picker to ensure strings that are more than one line look a bit nicer.

* on view -> in view
2024-02-02 16:44:22 -05:00
Joris Pelgröm
bd38cfb7c2
Bump Guava to 33.0.0-android (#4177)
- Bump Guava to the latest version, which removes the need for a dependency resolution strategy and (hopefully) un-breaks dependabot updates.
2024-02-02 15:27:43 -05:00
Márton Maráz
c185b871fd
Make volume sensors update instantly by subscribing to a broadcast (#4162)
* Make volume sensors update instantly by subscribing to a broadcast

* Change skippableActions to a 1-to-many map and the list of all volume sensors to the corresponding Intent action key
2024-02-02 15:25:55 -05:00
Joris Pelgröm
f3071e79e6
Wear Assist: show login when logged out, scroll first item into view (#4174)
- Update Assist on Wear to automatically open the login screen when logged out, instead of asking the user to close and login, to prevent text being cut off issues
 - Add another item at the top of Assist on Wear to allow the pipeline selector to be scrolled into the center of the screen (the first item cannot be scrolled into the center of the screen)
2024-01-30 18:43:49 +00:00
Joris Pelgröm
97d312bdd6
Androidx dependency updates late Jan 2024 (#4165)
- Update Wear Assist alignment to keep same appearance of an inline chevron to change the assistant
2024-01-27 17:58:40 +00:00
dependabot[bot]
4f98dc0858
Bump horologist from 0.5.18 to 0.5.19 (#4156)
* Bump horologist from 0.5.18 to 0.5.19

Bumps `horologist` from 0.5.18 to 0.5.19.

Updates `com.google.android.horologist:horologist-composables` from 0.5.18 to 0.5.19
- [Release notes](https://github.com/google/horologist/releases)
- [Commits](https://github.com/google/horologist/compare/v0.5.18...v0.5.19)

Updates `com.google.android.horologist:horologist-compose-layout` from 0.5.18 to 0.5.19
- [Release notes](https://github.com/google/horologist/releases)
- [Commits](https://github.com/google/horologist/compare/v0.5.18...v0.5.19)

---
updated-dependencies:
- dependency-name: com.google.android.horologist:horologist-composables
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: com.google.android.horologist:horologist-compose-layout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Enable core library desugaring for wear module

---------

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>
2024-01-25 16:17:38 -05:00
Joris Pelgröm
ff2b0ecc79
Replace 'Refresh interval' title with icon (#4144)
- To (hopefully) finally address review failures about text being cut off on round screens replace it with an icon. Same icon as used in the previous screen so should be pretty clear.
2024-01-24 10:58:36 -05:00
Sebastian Lövdahl
5d52735e36
Support multiple Template tiles on Wear OS (#3783)
* Support multiple Template tiles on Wear OS

* Add `TemplateTileConfig` data class

* Fix migration

* `Pair` -> `TemplateTileConfig` fixes

* Fix `getAllTemplateTiles` implementation

* Initial work on companion <-> wearable device communication

* More work on phone <-> wear device communication

* Save updated template in phone app

* Get the template to render using the right method

* Fix CI complaints

* Work on Wear UI for multiple template tiles

* Update wear manifest

* Wear migration and navigation fixes

* Fix Template tile IDs in mobile app

* Make adding a new Template tile on Wear device work

* Small cleanups and TODO fixes

* Try to fix template config refresh in settings

* Fix after rebase

* Adopt blocking approach for reacting to tile events, inspired by #3974

* Use `OpenTileSettingsActivity` for template tile

* Adopt Material 3 and other UI-related changes

* Show help text in phone app if no template tiles have been added yet

* Reference the view model variable inside the function

By having the view model variable outside the block, the updated template tile
might not be propagated to the template settings view.

* Reload template tiles when opening the template tiles from settings

* Replace null key with -1 for old template tile

* Lint complaints fixes

* remove TODO

* Store error

* Scrollable list of template tiles

* Move "Configure template tile" to header

* Replace with methods with copy

* Show template as secondary text

* Fix scrolling

* Update app/src/full/java/io/homeassistant/companion/android/settings/wear/views/SettingsWearTemplateTileList.kt

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

* Remove unused field

* Move padding to "no tiles" text

* Add deep link

---------

Co-authored-by: Joris Pelgröm <jpelgrom@users.noreply.github.com>
2024-01-24 10:56:39 -05:00
Daniel Shokouhi
8dd76734f8
Use horizontal padding on refresh interval per review comment (#4120) 2024-01-06 23:06:26 +01:00
Daniel Shokouhi
39b19b7fc3
Add padding to refresh interval to avoid text getting cut off (#4119) 2024-01-06 01:18:19 +00:00
Joris Pelgröm
62414e4cd5
Migrate BuildConfig to Gradle Build Files (#4049)
- Addresses the following warning: The option setting 'android.defaults.buildfeatures.buildconfig=true' is deprecated. Each module uses the BuildConfig class so it's added everywhere.
2023-12-15 12:46:48 -05:00
Steffen Klee
e0731c9c79
Add Wear OS TLS client certificate authentication (TLS CCA) support (#3924)
* Add Wear OS TLS client certificate authentication (TLS CCA) support

Wear OS does not currently allow the user to install certificates to the
system-wide KeyChain for TLS CCA support. This commit adds support for
using certificates from the app-specific Android KeyStore with UI for
setting up a certificate during the Wear OS onboarding process.
The manual step in the onboarding process is required since we cannot
transmit certificates of the Android KeyChain because they are not
extractable.

In particular, this commit adds the following changes:
* KeyStoreImpl as an additional KeyChainRepository interface
  implementation for loading and storing keys to the application's
  KeyStore. TLSHelper uses KeyStoreImpl as a fallback key manager.
* UI for selecting a certificate file with GET_CONTENT intent during
  Wear OS onboarding in OnboardingActivity if it is detected that the
  Home Assistant may require TLS CCA. The UI includes a password check
  for the PKCS12 container.
* During onboarding the app sends the raw PKCS12 data to Wear OS
  together with the container password. The connection is assumed to be
  encrypted and trusted so that no additional encryption is necessary.

* Move PKCS12 password check to lifecycle scope

* Remove redundant try-catch when loading PKCS12

* Simplify MobileAppIntegrationView layout code
2023-12-13 15:19:54 -05:00
Joseph Abbey
6b56bc579a
mobile_app_notification_cleared for wearos (#4035)
* mobile_app_notification_cleared for wearos

* Fix imports

* Remove database id extra

* Fix whitespace

* Reformatted imports and added the receiver to the manifest

* Move `handleDeleteIntent` to common
2023-12-13 14:45:46 -05:00
Joris Pelgröm
7d76bb4b51
Update tiles logged out state to prevent cut off overflow, shortcuts tile label (#3975)
Update tiles logged out state to prevent cut off overflow

 - Limit length of logged out state string to prevent text cut off and shorten strings to help with translations
 - Fix inconsistent shortcuts tile name
2023-10-28 11:15:22 -04:00
Joris Pelgröm
73c928d6e4
Update shortcut tile add/remove + destroy handling (#3974)
- Updates the shortcut tile's handling of add/remove event + destroying the service, just like the camera tile, to prevent the service scope being cancelled while the app is still storing tile added/removed
 - (this service already didn't overwrite existing tile data when onTileAddEvent was called again)
2023-10-28 11:14:55 -04:00
Joris Pelgröm
607833d4c7
Update launcher icon, Play Store feature graphic (#3960)
* Update launcher icon, Play Store feature graphic

 - Update launcher icon to better match other Android app launcher icon sizes
 - Update Play Store feature graphic to new version

* Cannot deduplicate this launcher icon on Wear

* ktlint
2023-10-20 17:47:26 -04:00
Daniel Shokouhi
e10ec793d4
Show sensor state in secondary label in Wear OS sensor UI (#3959)
* Show sensor state in secondary label in Wear OS sensor UI

* Review comments

* Remove runBlocking in previews and invert label check to match phone
2023-10-20 17:46:41 -04:00
Joris Pelgröm
cda25479d6
Add clear_notification support to Wear OS (#3956)
- Move the clear_notification command to common extensions and add support in the Wear OS app
2023-10-20 17:45:48 -04:00
Joris Pelgröm
a94c90e5aa
Improve camera tile add/remove event handling (#3954)
- If there is already a camera tile with the ID of the tile in `onTileAddEvent` stored in the database, don't overwrite it with a new blank tile as the user configuration might be lost.
 - Run add/remove event code blocking to prevent the system immediately destroying the service and as a result cancelling the work to save tile data in the database. Without the blocking code I could semi-reliably get it to destroy the service within several milliseconds of adding/removing, often preventing the database code from running.
2023-10-20 17:45:15 -04:00
Joris Pelgröm
26c6bcd282
Fix icon button sizes (#3918)
* Fix icon button sizes

* Merge fixes
2023-10-06 18:38:09 +00:00
Joris Pelgröm
65863148fc
Update entity button with toggle styling to match M3 components (#3923)
Update entity button styling to match M3 components
2023-10-06 18:08:22 +00:00
Daniel Shokouhi
2a597602f1
Fix detail pane after material 3 migration, add additional previews (#3920) 2023-10-06 12:56:48 -04:00
Daniel Shokouhi
709ca07e8c
Shorten some settings strings (#3921)
* Shorten some settings strings

* Remove unused string
2023-10-06 16:51:32 +00:00
Joris Pelgröm
f2e9541264
Fix Picker rotary input on some devices and update design (#3919) 2023-10-06 11:38:40 -04:00
Daniel Shokouhi
f23a6cb046
Update Chip and ToggleChip to Button and ToggleButton except for WearToggleChip (#3917)
* Update complication config screen to m3 components

* Clean up some code so its resuable

* Review comments and bump library

* Migrate more screens

* Review comments

* Tweak some colors

* Use consistent button container color

* Remove unnecessary font color

* Tweak Button disabled color to match ToggleButton

* Update a couple more chips and a preview

* Use in app color default
2023-10-06 11:37:17 -04:00
Daniel Shokouhi
d7a08d3b08
Update manual onboarding screens to prevent the button from overlapping elements (#3909)
* Update manual onboarding screen to prevent the button from overlapping elements

* Limit to 2 lines of text

* Switch to ScrollView

* Add padding for round devices

* Review comments
2023-10-05 09:58:08 -04:00
Daniel Shokouhi
d3a1f318f8
Begin migrating Wear OS components to Material 3 (#3904)
* First commit of migrating Wear OS components to Material 3

* Tweak more colors, fix some variables, use switches and bold more text

* More clean up

* Fix color in default chip

* Clean up unused code
2023-10-05 09:57:41 -04:00
Márton Maráz
2641422e50
Add NFC state sensor (#3905)
* Add first draft for NFC sensor

* Rename NfcSensorManager.nfcSensor to nfcStateSensor

* Move NfcSensorManager to the common module

* Add BroadcastReceiver subscription to NfcAdapter.ACTION_ADAPTER_STATE_CHANGED in both the app and wear modules

* Remove TODO comments

* Change updateType to INTENT

* Convert simple methods to expression body

* Change mdi:nfc to mdi:nfc-variant

* Fix docs URL

* Reword NFC sensor manager according to the PR suggestions
2023-10-05 09:57:33 -04:00
Daniel Shokouhi
49cc4aa7d3
Use recommended splash screen library for Wear OS (#3908)
* Use recommended splash screen library for Wear OS

* More tweaks per recommendations

* Add splash screen to Assist

* Add splash screen for Assist

* Use mipmap instead of drawable
2023-10-02 18:24:39 -04:00
Daniel Shokouhi
f9c7bceac0
Switch to Wear Device specific preview (#3906) 2023-10-02 18:23:48 -04:00
Joris Pelgröm
ae3248ca4d
Update Wear more details screen to prevent cut off (#3899) 2023-09-29 22:47:36 -04:00
Daniel Shokouhi
a15f7b3bc4
Add missing scroll bar to remaining screens (#3895)
* Add missing scroll bar to remaining screens

* Add Scaffold to ThemeLazyColumn

* Remove unneeded variable

* Remove nested scaffold
2023-09-29 08:29:56 -04:00
Joris Pelgröm
2f777a1379
ListHeader: fix text cut off (#3898)
ListHeader: set overflow, limit lines based on font size

 - Set overflow for ListHeader to ellipsis instead of cutting of text
 - Set the maximum number of lines for ListHeader based on the font size
 - Center text in the list header for nicer appearance in case of multiple ines
2023-09-28 17:40:39 -04:00
Joris Pelgröm
4a4cc31b97
Update icon (#3888)
* Update icon

 - Replace old icon with the new icon
 - Update app primary color to new blue tint
 - Deduplicate resources

* Update feature graphic

* Decouple app icon color from main color
2023-09-28 17:38:48 -04:00
Joris Pelgröm
43cc4d4a73
Fix rotary input after first screen & for picker (#3881)
- The recent switch to Horologist modifiers for rotary input broke after the first screen because of manual focus requesting, and the refresh interval picker in general so also switch that to a Horologist modifier.
2023-09-20 19:42:20 -04:00
Dubzer
20f87c810b
Add smooth scrolling for rotary input (#3876) 2023-09-19 15:39:25 -04:00
Joris Pelgröm
3915ec6d8f
Automatically fix broken registrations/webhooks (#3875) 2023-09-19 15:38:50 -04:00
Joris Pelgröm
2c20baf0f5
Add camera tile to Wear OS (#3870)
* [WIP] Prepare camera snapshot tile

* Deduplicate refresh views

* Get/save tile config in the database

* Deduplicate haptic click, add to camera refresh

* [WIP] Camera tile settings UI

 - Create UI to set camera tile settings
 - Reuse shortcut tile settings activity as a general tile settings activity

* Rename camera snapshot tile to camera tile

* Cleanup: camera entities selection, empty state, preview image

 - On initial load also create a list of camera entities to make it possible to select them without showing up elsewhere in the app
 - Add text to empty state instructing the user to set a camera
 - Update tile preview images

* Fix logged out state on missing tile config

* Force tile update on login

* Scale bitmap to fit inside screen size

 - Scale the received image to a bitmap that does not exceed the screen size to ensure timely refreshes and prevent parcels that are too big
2023-09-17 16:57:33 -04:00
Daniel Shokouhi
90bf7369e2
Clean up some left over code after update to getIcon (#3827) 2023-08-31 19:53:10 -04:00
Daniel Shokouhi
bb58a578dd
Use unavailable and unknown states consistently when dealing with sensors and entities (#3821)
* Use unavailable and unknown states consistently when dealing with sensors and entities

* Update more sensors

* Remove unused import
2023-08-28 17:43:25 -04:00
Daniel Shokouhi
6c2e555e57
Various changes to entity usage (#3816)
* Various changes to entity usage

* Remove unneeded code

* String fixes

* Remove redundant string
2023-08-26 16:53:31 -04:00
Joris Pelgröm
cde8dc9ee9
More dependency bumps (#3815) 2023-08-26 16:42:20 -04:00