Commit graph

1061 commits

Author SHA1 Message Date
Tiger Oakes 6c64b31f7e
Use collectAsState for SensorDao.getAllFlow (#2423) 2022-04-06 17:52:21 -04:00
Tiger Oakes cd008d9785
Streamline TileDao (#2422)
* Remove unused tileList

* Make TileDao.add a coroutine
2022-04-06 17:49:25 -04:00
Joris Pelgröm 6e8ed81455
Rename Lovelace to Dashboard (#2435)
- Renames Lovelace to Dashboard to follow core 2022.4
 - Remove unused string array that also included Lovelace
2022-04-06 17:44:27 -04:00
dependabot[bot] 7dada2d812
Bump sentry-android from 5.7.0 to 5.7.1 (#2415)
Bumps [sentry-android](https://github.com/getsentry/sentry-java) from 5.7.0 to 5.7.1.
- [Release notes](https://github.com/getsentry/sentry-java/releases)
- [Changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-java/compare/5.7.0...5.7.1)

---
updated-dependencies:
- dependency-name: io.sentry:sentry-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-03 08:40:07 -04:00
Tiger Oakes c788901778
Use suspend calls for widget daos (#2410)
* Add base interface for widget entities

* Helper for widget flow -> state

* Refactor ManageWidgetsView to avoid duplicate code and string types

* Switch add/deleteAll to suspend

* Change abstract functions to suspend

* Remove unused imports
2022-04-03 08:35:15 -04:00
Joris Pelgröm c2f0293837
Faster 'Detected Activity' sensor while updating fast (#2420)
- Request an update for the detected activity sensor every minute if the app is currently doing faster sensor updates, instead of every 2 minutes, to try to have an up-to-date recognition value every time the data is sent.
 - Fix inconsistent update behaviour after changing the setting but before restarting when registered for the ACTION_TIME_TICK intent by always checking the setting, and not only when set to 'fast while charging'.
2022-04-03 08:28:27 -04:00
Joris Pelgröm aaef43ae38
Improve Manage sensors list and details screens (#2418)
* Add sticky headers to manage sensors list

 - The list of managers, and for some managers the list of sensors, is getting so long that sticky headers while scrolling is nice to have to quickly see where you are when doing a fast scroll
 - Remove useless sorting of managers, original list is already sorted

* Include manager name in manage sensors search

 - Also match sensors when using the search function in the manage sensors list when their manager's name matches the search query. This will for example allow searching for all audio sensors, or finding high accuracy mode when searching for location.

* Add stateless/fallback/default icons to sensors

 - Add a new stateless icon to sensors that is used as a default/fallback within the UI
 - Add icons for sensors to the main list of sensors, blue like in the frontend when enabled and disabled alpha when disabled
 - Name deviceClass and unitOfMeasurement arguments where used in sensors

* Fix sensor a-z sorting

* Show entity in details screen more like frontend

 - Update the design for the entity details screen to closer match what is shown in the frontend; at the top of the screen there is now a card that mimics the layout of the entity on the (default) dashboard. This includes the icon (no longer text only), name (previously completely absent from this screen) and the state. Enable/disable is now better highlighted.
 - Some technical information was removed, in line with making this page less like a database dump (use dev tools if that's required).

* Show 'None selected' for empty multi-list preferences

* Add info about update frequency to BasicSensor

 - Adds information about the update frequency to a BasicSensor
 - Change design for sensor details to better highlight description, and add a chip that shows current sensor update frequency taking into account app settings and Android version

* Change description on Sensor Update Frequency screen

* Fix description

* Change update type for detected activity sensor

 - This uses a callback on a ~2 minute interval but can be more frequent when other apps are using the API. Worker updates only re-register the callback.

* Revert "Change update type for detected activity sensor"

 - It might be updated faster but doesn't actually send new values any faster
2022-04-03 08:25:01 -04:00
Tiger Oakes 0f26ce3382
Remove blocking calls from HaControls (#2413)
* Launch performAction in a coroutine scope

* Change performAction to suspend function
2022-04-03 08:05:40 -04:00
Daniel Shokouhi e4c069f743
Update changelog for week of 3/25 (#2406) 2022-03-26 13:14:00 -07:00
Joris Pelgröm ac83869cfa
Add AppDatabase v24 -> v25 auto migration (#2407)
* Add AppDatabase v24 -> v25 migration

* Export Room schema to use AutoMigration instead
2022-03-25 20:02:44 -04:00
Daniel Shokouhi ff0fb0da89
Bump DB version to prevent a crash on updating (#2405) 2022-03-25 13:43:16 -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
Julien Ehrhart cfd277e2f7
Correct minimal value for high_accuracy_set_update_interval (#2402)
Fixes #2401
2022-03-25 12:46:03 -04:00
Joris Pelgröm 0623d16142
Fix gesture detection on WebViewActivity (#2396)
* Fix gesture detection on WebViewActivity

 - Add actual gesture detection to the webview instead of pointer detection in order to fix the search box showing up any time 3 fingers are placed on the screen

* Remove nullable min/max velocity

 - These always get a value so there is no need to make them initially nullable

* Cleanup fling detection

* Reduce minimum swipe velocity requirement

* Change direction calculation to average

 - Use the average velocity of all pointers to determine in which direction the user has swiped. The previous implementation used the first/last pointer's angle which isn't necessarily the same pointer.
 - Fix reducing number of pointers when velocity tracker is reset due to an opposing pointer
2022-03-25 12:44:06 -04:00
Daniel Shokouhi 7c05b899b1
Add missing volume streams to sensor and command (#2397)
* Add missing volume streams to sensor and command

* Add more missing volume streams and 1 missing audio mode
2022-03-25 12:09:59 -04:00
Joris Pelgröm 668cc0c73d
Update settings screens styling (#2393)
* Change toolbar/status bar for configuration

 - Change the colors used for the toolbar and status bar for configuration from the blue accent color to a white, to better match the default frontend theme

* Switch to AppCompat SearchView

* Update Wear settings' app bar, up everywhere

 - Update Wear settings' top app bar in the app to also use the white style and activity theme
 - Add up navigation to all screens in Wear settings

* Compose settings design consistency updates

 - When there is a scrollable column, use a scrollable Box instead around that column to make sure the padding is applied to the content instead of the entire scrollable container (which always gives padding at the top/bottom of the screen, even when content is scrolled)
 - Consistently use 16dp for content padding instead of a mix of 16 and 20; 16 matches the other non-Compose settings so let's use that
2022-03-22 20:30:53 -04:00
dependabot[bot] 164cef80fa
Bump actions/cache from 2 to 3 (#2394)
Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-22 20:18:21 -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
Daniel Shokouhi ead6a9377f
Add a command to easily launch an application, or take user to install page (#2390) 2022-03-22 20:16:21 -04:00
Daniel Shokouhi 0d9a1367b5
Fix SIM sensor crash (#2389)
* Fix SIM sensor crash

* Update app/src/main/java/io/homeassistant/companion/android/sensors/PhoneStateSensorManager.kt

Co-authored-by: Justin Bassett <bassett.justint@gmail.com>

* Update app/src/main/java/io/homeassistant/companion/android/sensors/PhoneStateSensorManager.kt

Co-authored-by: Justin Bassett <bassett.justint@gmail.com>

* lint

Co-authored-by: Justin Bassett <bassett.justint@gmail.com>
2022-03-22 20:14:14 -04:00
Richard de Boer 1642e14242
fix headphone sensor: check audio OUTPUT devices, not INPUT (#2388)
Fixes #2387
This probably worked fine with headsets, as those also provide audio input.
2022-03-21 12:54:17 -04:00
chriss158 f80e03aa3b
Fix new line in message (#2385)
* Fix high accuracy mode turns off after turning on with command

* Fix new line replacement in message

* Add comment

* Revert "Fix high accuracy mode turns off after turning on with command"

This reverts commit 4c769bf1b1.
2022-03-20 17:24:36 -04:00
chriss158 e24712dcd9
Fix high accuracy mode turns off after turning on with command (#2383) 2022-03-20 17:19:39 -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
dependabot[bot] 3061791a4d
Bump sentry-android from 5.6.3 to 5.7.0 (#2380)
Bumps [sentry-android](https://github.com/getsentry/sentry-java) from 5.6.3 to 5.7.0.
- [Release notes](https://github.com/getsentry/sentry-java/releases)
- [Changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-java/compare/5.6.3...5.7.0)

---
updated-dependencies:
- dependency-name: io.sentry:sentry-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-03-19 12:12:43 -04:00
dependabot[bot] fa890f7660
Bump android-beacon-library from 2.19.3 to 2.19.4 (#2378)
Bumps [android-beacon-library](https://github.com/AltBeacon/android-beacon-library) from 2.19.3 to 2.19.4.
- [Release notes](https://github.com/AltBeacon/android-beacon-library/releases)
- [Changelog](https://github.com/AltBeacon/android-beacon-library/blob/master/CHANGELOG.md)
- [Commits](https://github.com/AltBeacon/android-beacon-library/commits/2.19.4)

---
updated-dependencies:
- dependency-name: org.altbeacon:android-beacon-library
  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:09:02 -04:00
Daniel Shokouhi 1351237f9f
Fix widget crash on orientation change and landscape layout fixes (#2377) 2022-03-19 12:08:47 -04:00
Daniel Shokouhi b151f20962
Update changelog for week of 3/11 (#2365)
* Update changelog for week of 3/11

* Updates
2022-03-15 10:29:59 -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
Joris Pelgröm 27514e6df1
Remove internet connectivity requirement for WebsocketManager (#2373)
- Replace the NetworkType.CONNECTED constraint on the job for WebsocketManager with a check that does not take the validation status (= internet access) of the network into account. HA may be accessible without an internet connection.
2022-03-15 09:18:49 -04:00
dependabot[bot] 94a31c52ce
Bump sentry-android from 5.6.2 to 5.6.3 (#2370)
Bumps [sentry-android](https://github.com/getsentry/sentry-java) from 5.6.2 to 5.6.3.
- [Release notes](https://github.com/getsentry/sentry-java/releases)
- [Changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-java/compare/5.6.2...5.6.3)

---
updated-dependencies:
- dependency-name: io.sentry:sentry-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-03-15 09:13:09 -04:00
Joris Pelgröm 3e928bd53d
Migrate "Manage Sensors" to Compose and ViewModels (#2359)
* Replace PreferenceFragment sensors list with Compose

 - Start of migrating the list of sensors and their individual on/off settings to Compose by moving the list over
 - Aims to replicate original design of the page for now

* Rename ViewModel to match view

* Start of sensor detail screen in Compose

 - Add enabled switch and description + permission handling
 - Update main list to use new Compose-based fragment
 - Add new fragments to factory to prevent crash on recreation

* More sensor info to show

 - Add more properties and attributes for the sensor (basically anything that doesn't require a pop-up)
 - Move enabled check with permissions to ViewModel because it also needs to be updated in the database
 - Fix collecting sensor settings

* Add support for sensor settings toggle/text/number

 - Added a framework for setting sensor settings; toggle builds on the existing on/off toggle, and added a MutableState for settings that require the app to show a dialog
 - Support for changing sensor settings that must be toggled
 - Support for changing sensor settings where text or number input is required

* Finish sensor details by adding list-based settings

 - Add support for setting list-based settings
 - Dynamic maximum height for dialog in order to fill most of the screen
 - Remove old fragment and XML since all functionality should now be covered
 - Show translated setting for list settings
 - Fix update of list setting removing the list options in the future, because they were stored in the DB entry but a new entry without any values was created
 - Fix toggle sensor setting (removed the space)

* Tweak single rows with switch and height

 - Don't use two line row height if there is no summary
 - Remove onCheckedChange from Switch so that it is handled by the row
 - Prevent text from getting too close to switch

* UI fixes and tweaks

 - Fix search query still being set when returning to the main sensors list after viewing a sensor's details by clearing the query in the view model if the SearchView is closed
 - Move sorting the sensors for each manager to the UI where the sensors are queried, instead of in an internal variable
 - Set secondary color to allow Switches, RadioButtons and Checkboxes to use the blue HA tint without overriding each one manually
 - Add stable IDs to main sensor list to improve recomposition for search

* Allow selecting some rows in details

* Move dialog popup into a separate file

 - Move the dialog that is used to a separate file because it was already based on a custom dialog for the Manage Widgets screen.
 - Improve max height for dialog by using weight, to make sure it still works correctly for longer titles
 - When using radio button items, don't require the user to press save but instead save it when an item is selected

* Show disabled state for sensor setting rows

* Update unchecked switch thumb colors

 - Google says using the same color as the surface with a minimal shaodw is by design, https://issuetracker.google.com/issues/185418990, but it just results in bad contrast (probably why they switched to a different switch design in Android 12), so manually copied the color code to use

* Also use disabled state for sensor setting row summary

* Fix comment
2022-03-15 08:57:09 -04:00
Daniel Shokouhi 57993c05b4
Add a transport sensor (#2358) 2022-03-15 08:37:18 -04:00
Daniel Shokouhi bc8765894e
Allow changing high accuracy update interval via command (#2356)
* Allow changing high accuracy update interval via command

* Fix minimal build
2022-03-15 08:35:08 -04:00
Nicolas Mowen 2de5815123
Force resize of video frames instead of compressing (#2362)
* Force resize

* Remove unused import
2022-03-11 07:58:24 -05:00
dependabot[bot] 22ea119b5e
Bump firebase-appdistribution-gradle from 3.0.0 to 3.0.1 (#2364)
Bumps firebase-appdistribution-gradle from 3.0.0 to 3.0.1.

---
updated-dependencies:
- dependency-name: com.google.firebase:firebase-appdistribution-gradle
  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-11 07:51:39 -05:00
Daniel Shokouhi 106b8ef729
Replace websocket with persistent connection in string (#2361) 2022-03-10 14:22:25 -05:00
Daniel Shokouhi 9397d1a565
Hide delete icon on more app created channels (#2354) 2022-03-10 13:59:44 -05:00
Nicolas Mowen 5fc004aa3d
Video notifications max memory (#2353)
* Compress bitmaps to avoid remoteview memory utilization error.

* Cleanup

* Add log helpful for debugging

* Make formatting more consistent with standard notification view

* Switch to only using time based method

* Remove random image

* Fix lint

* Update order of imports
2022-03-10 13:55:50 -05:00
Daniel Shokouhi e3a96d588e
Correctly identify entity category for sensors (#2357) 2022-03-09 08:00:38 -08:00
leroyboerefijn 261ae31fed
Add haptic feedback to templite tile refresh (#2349) 2022-03-07 21:59:17 -05:00
Daniel Shokouhi 00827d5944
Only skip some reports when high accuracy mode is off (#2347)
* Only skip some reports when high accuracy mode is off

* Use correct function
2022-03-07 21:47:18 -05:00
Nicolas Mowen 508893f02f
FEAT: Ability to show video in notification as a gif (#2342)
* Download mp4 and parse out frames using MediaMetaDataRetriever

* Add view and remote views implementation

* Smoothen out frame selection

* Add constants

* Support all frame rates of video and set frames to show over 2 seconds
2022-03-07 21:42:55 -05:00
Daniel Shokouhi d6f638673a
Add manage notification channels settings screen so users can easily delete channels created by the app (#2340)
* Add a setting screen to easily delete notification channels and edit them

* Minor clean up

* Code review and suggestions

* Code review
2022-03-07 21:41:21 -05:00
Daniel Shokouhi 2a2422b678
Update change log for week of 3/4 (#2338)
* Update change log for week of 3/4

* Changelog update

* Tweak
2022-03-05 21:14:51 -05:00
Daniel Shokouhi d05920d3c3
Check for phone permissions when using call intent (#2344) 2022-03-05 20:00:53 -05:00
Daniel Shokouhi eae2c6e67d
Breaking Change: Make coordinate attributes all lower case for HA compatibility (#2341)
* Make coordinate attributes all lower case for HA compatibility

* Make rest of sensor attributes match expected casing
2022-03-05 19:59:27 -05:00
dependabot[bot] ad57b00bfb
Bump sentry-android from 5.6.1 to 5.6.2 (#2335)
Bumps [sentry-android](https://github.com/getsentry/sentry-java) from 5.6.1 to 5.6.2.
- [Release notes](https://github.com/getsentry/sentry-java/releases)
- [Changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-java/compare/5.6.1...5.6.2)

---
updated-dependencies:
- dependency-name: io.sentry:sentry-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-03-05 07:32:27 -05:00
Daniel Shokouhi dda9798713
Add new settings screen to change Sensor Update Frequency (#2317)
* Add option for faster sensor updates, and also while charging

* Move settings to its own view, change logic to store in DB

* Set default value

* Try another way

* Try new default method

* Use correct default

* Clean up

* Review comments

* Remove dependency on is_charging sensor

* Switch to a better condition check per review

* Fix db
2022-03-03 20:19:31 -05:00