Commit Graph

1423 Commits

Author SHA1 Message Date
Daniel Shokouhi 3833e73dfe
Update change log week of 5/17 (#4411) 2024-05-17 10:39:58 -07:00
Joris Pelgröm 62673fc7a3
Quick fix minor warnings from Android Studio (#4406)
- 'getter for isSpeakerphoneOn: Boolean' is deprecated. Deprecated in Java
 - Unnecessary safe call on a non-null receiver of type Intent
 - The corresponding parameter in the supertype 'BaseWidgetConfigureActivity' is named 'savedInstanceState'. This may cause problems when calling this function with named arguments.
2024-05-15 14:30:54 -07: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
Joris Pelgröm 395b553772
Prevent race creating + clean up sensor entries for old/deleted servers (#4386)
- Prevent a race on logout from the frontend between updating the sensors and deleting the server data, causing stale sensor entries
 - During periodic sensor updates, clean up any orphaned sensor entries there might be (because of this bug or other race conditions we're unaware of)
2024-05-06 08:15:29 -07:00
Daniel Shokouhi ab2753685e
Update change log week of 5/3 (#4382)
* Update change log week of 5/3

* Remove mention of sensor in automotive since it doesnt have it
2024-05-04 12:57:25 -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
Joris Pelgröm 674f5d4c5f
Add QR code scanner for frontend (#4303)
* Basic barcode scanner functionality

* Add overlay with cutout and toggle flashlight

 - Add a overlay with cutout in the middle / on the side, matching design and Google's barcode scanner
 - Working button for toggling the flashlight on and off

* Fix background camera use, complete more UI

 - Fix camera remaining active when the activity is paused (for example, by going to another app)
 - Set the app's theme
 - Add more UI parts: title, subtitle, optional action button

* Complete scanner UI

 - Request permission when launched, and add snackbar when permission is denied
 - Add flashlight button and position it to line up with the frame
 - Make title/subtitle/action dynamic
 - Fix double scrim for system bars on older API levels

* Add dependency to automotive as we can't exclude features

* More automotive dependencies

* Return information about barcode format

* Implement external bus for scanner

* Fix external bus type

 - The type for external bus messages should be command, with the bar_code/* in the key command
 - Send aborted when closing the scanner using back

* Improve feature availability check

 - Make sure the device actually has a camera and is not automotive
2024-05-02 17:55:22 -07: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 d733b405cc
Update change log week of 4/20 (#4354) 2024-04-20 16:26:38 -07:00
Joris Pelgröm f37e34e9de
Provide interface for external bus outside WebViewActivity (#4338)
- Adds an interface to the app to interact with the external bus outside the WebViewActivity. This should make it possible for the frontend to control more native UI of the app.
2024-04-20 11:09:52 -07:00
bbrockbernd a3630393bf
Fix runBlocking in coroutines (#4340)
* Fixed runBlocking call in suspend function DefaultSliderControl.performAction

* Fixed runBlocking in LanguagesManager.getCurrentLang. This function is always called from a coroutine.

* Fixed runBlocking in LanguagesManager.saveLang. This function is always called from a coroutine.

* Fixed runBlocking in LocationSensorManager.sendLocationUpdate. This function is always called from a coroutine.

* Fixed runBlocking for ThemesManager.saveTheme and ThemesManager.getCurrentTheme

* Fixed ktlint
2024-04-20 11:09:17 -07:00
Joseph 4965254a69
Add support for voice command action (#4331)
* Add assistant headset support

* Revert AudioUrlPlayerService back to AudioUrlPlayer

* Address feedback
2024-04-20 15:46:35 +02: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
Daniel Shokouhi 177a040f57
Update change log week of 4/6 (#4320)
* Bump change log version

* Update change log
2024-04-06 16:00:12 +00:00
Daniel Shokouhi 973b50d4c7
Update change log week of 3/29 (#4310)
* Update change log week of 3/29

* Remove mentioning battery sensors from automotive and dont mention entity state change
2024-03-30 23:01:24 +01:00
Joris Pelgröm 3154f9a0ca
Allow multiple tasks for `command_webview` (#4307)
Allow multiple tasks for command_webview
2024-03-29 08:16:50 -07:00
Joris Pelgröm 20cecf7790
Remove deprecated Accompanist System UI controller (#4298) 2024-03-26 15:29:47 -07:00
Joris Pelgröm acb81ba920
Pre-fill entity state widget label with entity name (#4296)
- When creating a new entity state widget, if the label is empty pre-fill it with the name for that entity to improve the initial UX. This does not apply when you've edited the label (or are editing a saved widget) until cleared.
2024-03-26 15:17:27 -07:00
Joris Pelgröm 5bf22b8631
Check protocol/port when determining reload for WebView (#4297)
- When determining whether the WebView should be reloaded with the current server URL, also check that the protocol (http/https) and port (8123, 443, ...) match and if not reload.
2024-03-26 15:14:28 -07:00
Nicolas Mowen de3a3481e2
Fix normal images not working after gif changes (#4289)
Fix normal images not working
2024-03-25 08:10:40 -07:00
Daniel Shokouhi 2eaf0cddb2
Update change log week of 3/22 (#4287)
* Update change log week of 3/22

* Remove mention of transmitter setting on Wear OS as its not supported

* Mention GIF support
2024-03-23 09:30:13 -07:00
Nicolas Mowen ef6327ffb3
Support showing all frames of animated gif image in Android 14+ (#4284)
* Support showing all frames of animated gif when sent as image in Android 14+

* Use unique image names and delete existing files that are no longer needed

* Fix lint

* update behavior to keep 2 days of images
2024-03-23 09:55:56 -04:00
Roffild 5729bbe6f0
Notification: "when_relative" for "chronometer" (#4273)
"timeout" is relative, but "when" is absolute by default.

It is now possible to synchronize timers in seconds without time difference:
```yaml
timeout: 120
chronometer: "true"
when: 120
when_relative: "true"
```
2024-03-22 11:45:40 +01:00
Daniel Shokouhi d342d642b7
Update change log week of 3/15 (#4274) 2024-03-16 12:36:02 -07:00
Daniel Shokouhi 3d8bd0151a
Hide hidden navigation entities in android auto (#4249) 2024-03-11 15:22:03 -07:00
Joris Pelgröm 6ff3560146
Controls: prevent individual server error from blocking all others (#4262)
- Catch exceptions thrown while loading all controls on a server level, to make sure that an issue with one server doesn't prevent data from other servers from showing.
2024-03-11 17:50:22 -04:00
dependabot[bot] 9aece78bce
Bump hilt from 2.50 to 2.51 (#4234)
* Bump hilt from 2.50 to 2.51

Bumps `hilt` from 2.50 to 2.51.

Updates `com.google.dagger:hilt-android-compiler` from 2.50 to 2.51
- [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.50...dagger-2.51)

Updates `com.google.dagger:hilt-android` from 2.50 to 2.51
- [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.50...dagger-2.51)

Updates `com.google.dagger.hilt.android` from 2.50 to 2.51
- [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.50...dagger-2.51)

---
updated-dependencies:
- dependency-name: com.google.dagger:hilt-android-compiler
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.google.dagger:hilt-android
  dependency-type: direct:production
  update-type: version-update:semver-minor
- 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>

* Remove protected from ServerManager inject

---------

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-29 17:27:05 -05:00
Joris Pelgröm 835b50f0e3
Update Assist dialog state when transitioning locked<>unlocked (#4235)
- Update the dialog flags for showing the Assist dialog when locked to prevent unintentional resuming in another locked state and clear contents when resumed intentionally (assistant intent action)
2024-02-29 17:26:07 -05:00
dependabot[bot] 48ac7037c2
Bump com.github.Dimezis:BlurView from version-1.6.6 to version-2.0.4 (#4220)
* Bump com.github.Dimezis:BlurView from version-1.6.6 to version-2.0.4

Bumps com.github.Dimezis:BlurView from version-1.6.6 to version-2.0.4.

---
updated-dependencies:
- dependency-name: com.github.Dimezis:BlurView
  dependency-type: direct:production
...

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

* Fix build: use convenience method which sets algorithm, remove functions matching defaults

---------

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-24 19:37:26 +00:00
Daniel Shokouhi 2e30f270ee
Update change log week of 2/23 (#4222) 2024-02-24 09:55:51 -08:00
Daniel Shokouhi b3b61ae5bf
Add command screen off to write permissions method (#4223) 2024-02-24 12:28:51 -05:00
StopMotionCuber 45e0ca9caa
Add ability for ClimateControl Card to cycle through entity states (#4142)
* Add ability for ClimateControl Card to cycle through entity states

* Fix ktlint issue

* Set `currentMode` after sending request for cycling through modes

* Display thermostat always as "on"

* Use "toggle" string from widget_tap_action_toggle

* Use hashMap to save states of entities as we're in a singleton

* Include support for colliding entityIds when using multi server within ClimateControl

* Add comment why ToggleRangeTemplate is always set to checked
2024-02-22 17:06:43 -05: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
Daniel Shokouhi 075bc50a07
Update change log week of 2/2/24 (#4186) 2024-02-02 17:18:25 -08: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 f95b482e53
Replace deprecated MdcTheme with 'normal' theme matching XML theme (#4182)
- MdcTheme appears to have been deprecated in the latest release. Replace it with our own theme everywhere it is used. Thankfully, because the modifications for the HA (XML) theme are very minor compared to a default Material theme there's not a lot to define/duplicate.
2024-02-02 15:30:41 -05:00
Jorden 1786a7d3e6
Fix button widget on Samsung devices (#4181)
Fix button widget
2024-02-02 15:27:03 -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
Daniel Shokouhi 44807af50f
Update change log week of 1/26 (#4163) 2024-01-27 10:17:02 -08: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
Joris Pelgröm c6ddca8fdc
Support image entity in camera widget (now renamed picture widget) (#4159)
- Allow selecting image entities in the camera widget
 - Rename camera widget to picture widget to better reflect camera + image entity support
2024-01-25 17:02:51 -05:00
Joris Pelgröm d9e65f8e5d
Remove Thread credential sync from start of Matter commissioning flow (#4150)
- After discussion with Thread dev, remove Thread credential syncing from the start of the Matter commissioning flow. There are 2 major reasons for this:
   * it significantly slows down the flow while only being useful some of the time
   * the results have limited usefulness because the API limits how much Home Assistant can influence the device data
  The alternative for the user is to use the manual 'import credentials' button in the frontend (matching iOS), or access the sync option in the app settings > troubleshooting menu.
2024-01-24 13:06:48 -05:00
Iván Cea Fontenla b0f1aa2906
Integrate car sensors with automotive, and added permissions (#4122)
* Integrate car sensors with automotive, and added permissions

* Set context in every call

* Fixed CarSensorManager format

* Enable car sensors only on correct flavors

* Fixed format

* Renamed context to latestContext and added parenthesis to expression
2024-01-24 10:57:27 -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 b3b74fae0e
Update change log week of 1/12 (#4133)
* Update change log week of 1/12

* Update matter and thread change
2024-01-12 12:07:53 -08:00
Joris Pelgröm a5efe6a9ab
Support for Thread "import credentials" from frontend (#4128)
* Support for Thread "import credentials" frontend action

 - Add support for the frontend action to import Thread credentials, or better said export Thread credentials from the device. This is essentially a very basic sync.

* Rename/reorder reused Matter code

 - Change names and order of reused Matter code for Thread importing to prevent potential confusion

* Update minimal implementation
2024-01-12 09:20:57 -05:00
Daniel Shokouhi b4c4c7a458
Update change log week of 1/5 (#4117)
* Update change log week of 1/5

* Add note about Matter
2024-01-05 18:07:24 -08:00
Joris Pelgröm f1fcabb0c9
Send IP address of Matter device for on network commissioning (#4069)
* [WIP] Send IP of device during commissioning

* Add version check for IP address in commission_on_network

* Update minimal
2024-01-04 14:29:19 -05:00
Joris Pelgröm 1162a82c48
Suppress system Matter device discovery bottom sheet (#4062)
- Prevents the system's Matter device discovery bottom sheet from showing up while the Home Assistant app is opened.
2023-12-20 12:26:04 -05:00
Joris Pelgröm 7cc545bfac
Fix button widget authentication dismissed due to non-foreground window (#4066)
- Fixes the button widget authentication dialog automatically being dismissed when triggered on Android 14 QPR1+, because the window was not in the foreground. It looks like the framework check for this was bugged before QPR1, and the Home Assistant app was showing the authentication dialog before the window (which is transparent) was in the foreground.
2023-12-20 12:25:06 -05:00