Commit graph

1004 commits

Author SHA1 Message Date
Joris Pelgröm 232fbb2b2d
Better state change subscriptions in entity state and media player widgets (#2814)
Implement subscribe_trigger and use it in widgets

 - Implement support for subscribing using subscribe_trigger, currently used to get state changes only for specific entities
 - Change the entity state and media player widgets to use this new subscription instead of subscribing to all state changes, based on the template widget
 - Removed some placeholder code from media player widget
2022-09-05 09:56:44 -04:00
RoboMagus 2cf5a7d215
Option to bypass app lock on home network (#2800)
* Add setting to bypass app lock on home network

* Debug loging to check logic

* Fix logic. Cleanup logging.

* Disable home lock bypass when no home networks are configured.

* Only check for WiFi SSID, not internal URL when evaluating isLockEnabled.

* Fix build error
2022-09-05 09:53:07 -04:00
andyboeh 6b06e0d8a8
Add authentication to widget buttons (#2798) 2022-09-05 09:50:53 -04:00
Daniel Shokouhi 6e647cb436
Only add next subscription if control is not null (#2812)
* Only add next subscription if control is not null

* Add one more null check for control
2022-08-29 20:50:09 -04:00
Aaron Wood cfafffd27f
Remove toast when failing to send notification clear event (#2576) 2022-08-29 20:31:49 -04:00
Joris Pelgröm e30390533d
Don't notify about cancellations in WebsocketManager (#2831)
Don't notify about cancellations in WebSocketManager
2022-08-29 20:27:46 -04:00
Joris Pelgröm af0371fb7b
Fix adding media player widget from settings (#2813)
- Adding a media player widget from settings didn't work because the list used to check that entities have been selected isn't updated immediately, but only on load or in a callback after pinning the widget. To work around this, manually check it before pinning the widget.
2022-08-29 20:26:39 -04:00
Daniel Shokouhi db8913c712
Breaking Change: Add some more attributes to geocoded sensor and check that device supports it (#2809)
* Add some more attributes to geocoded sensor and check that device supports it

* Remove language attribute as it does not supply the expected data

* Combine latitude and longitude into the location attribute again
2022-08-29 20:25:48 -04:00
Joris Pelgröm a995d9410b
Support multiple subscriptions of same type in websocket and use in template widget (#2801)
* Update WebSocketRepository for multiple subscriptions of same type

 - Change the structure of how the websocket repository tracks individual subscriptions to allow subscribing multiple times with the same type, but different data

* Update TemplateWidget to use template subscriptions

 - Instead of depending on entity state changes and refreshing any time there is a change, use the render_template subscription for the template widget to limit the amount of data and power used. To make this possible without too much abstractions, the TemplateWidget no longer implements BaseWidgetProvider.
 - Fix hardcoded "Loading" string

* Handle potential null subscription ID

 - Implements #2795 for changes to tracked subscription ID

* Handle failed subscribing similar to other failures (null)

 - When subscribing fails, return null and don't store an active subscription instead of continuing and returning a flow (which would never emit messages)

* Update manifest
2022-08-29 20:23:48 -04:00
Daniel Shokouhi ebc6b76dda
Update changelog week of 8/19 (#2808)
* Update changelog week of 8/19

* Mention battery power sensor
2022-08-20 08:52:49 -07:00
dependabot[bot] 358854b894
Bump sentry-android from 6.3.1 to 6.4.0 (#2806)
Bumps [sentry-android](https://github.com/getsentry/sentry-java) from 6.3.1 to 6.4.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/6.3.1...6.4.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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-19 20:35:11 -04:00
Daniel Shokouhi efdd5272e0
Add exclude recents flag to avoid showing multiple open activities in recents (#2805)
Add exclude recents flag to avoid showing multiple open activities
2022-08-19 20:34:57 -04:00
Daniel Shokouhi da8263dc9c
Only update geocode sensor if accuracy and time are valid, like location updates (#2802) 2022-08-19 20:34:33 -04:00
Daniel Shokouhi ae0f788bb4
Expand the error so its more meaningful (#2794) 2022-08-19 20:30:55 -04:00
dependabot[bot] e7dcdacda0
Bump accompanist-appcompat-theme from 0.25.0 to 0.25.1 (#2787)
Bumps [accompanist-appcompat-theme](https://github.com/google/accompanist) from 0.25.0 to 0.25.1.
- [Release notes](https://github.com/google/accompanist/releases)
- [Commits](https://github.com/google/accompanist/compare/v0.25.0...v0.25.1)

---
updated-dependencies:
- dependency-name: com.google.accompanist:accompanist-appcompat-theme
  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-08-13 20:58:03 -04:00
Daniel Shokouhi 7f5ec402db
Bump some more app dependencies (#2792) 2022-08-13 20:52:34 -04:00
Joris Pelgröm 550c18c6e2
Handle foreground service restrictions for persistent connection (#2790)
* Handle foreground service restrictions for persistent connection

 - When trying to start the WebsocketManager as a foreground service, catch exceptions due to restrictions and show the user a notification to fix it

* Update logging in WebsocketManager
2022-08-13 20:49:55 -04:00
Joris Pelgröm 5e11df521c
Fix opening my.home-assistant.io links (#2780) 2022-08-13 20:38:07 -04:00
Joris Pelgröm 3436f2169d
Use OkHttpClient to download notification videos (#2779)
- Change to the OkHttpClient used elsewhere by the app to download notification videos to resolve problems related to cookies and mTLS authentication. As a result, storing and deleting the file is now handled by the app instead of by the system.
2022-08-13 20:37:26 -04:00
Daniel Shokouhi d3c22cf341
Fix unable to Toast on QS tiles being clicked error (#2776)
* Fix unable to Toast on QS tiles being clicked error

* Review comments
2022-08-13 20:36:32 -04:00
Daniel Shokouhi 03a356f147
Only change channel if variable actually provided (#2773) 2022-08-13 20:33:22 -04:00
Rogue136198 0c9e8ac65f
Improve Notification GIFs (#2657)
* Modify Notification GIF Framerate

Modoify VIDEO_INCREMENT_MICROSECONDS to have notification GIFs generate a frame every 0.5 seconds for a video instead of the current every 2 seconds. This should result in smoother notification animations thus improving the UX

* Increase processingFrames.size

Increase processingFrames.size as increasing the framerate results in the animation ending too soon

* Scale video to a max width of 480 while maintaining video ratio

Notification video width scaled to 480. (1920 / 4) Height will scale accordingly while maintaining video aspect ratio. e.g. 1920x2560 will be scaled to 480x640

Frames are set to every 1 seconds with 5 frames resulting in a 5 second GIF

* Update MessagingManager.kt

Based on research and rapid prototyping under another fork, I've decided that scaling the image to a fixed width and a ratioed height is not going to work. There are issues that need to be resolved which result in the image being cut off and stretched in the notification. 

End result is the only overall change is changing the frame generation from once every 2 seconds to once every 1 second. This has improved the fluidity of notifications but I understand is my own subjective opinion.

This means there is still a potential case where 4K cameras will exceed the size limits of notifications.

* Typo fix

* Re-Implement Scaling to a Constant Width

* Update MessagingManager.kt

* Add logic to not scale videos smaller than specified width and Increase GIF speed (ViewFlipper)

* Tune processing times

Tune processing time to have one frame generated every 0.75s, then frames are played back at 3x speed. This results in 9 seconds of activity being played in 3 seconds.

* Implement Dynamic Frame Count

Dynamic number of frames up to a specified size limit (currently 2.5MB)

* Review Before Merge
2022-08-13 20:33:00 -04:00
Joris Pelgröm 22df320fd9
Use OkHttpClient to download notification images (#2768)
- Change to the OkHttpClient used elsewhere by the app to download notification images to resolve problems related to cookies and mTLS authentication
2022-08-06 13:03:38 -04:00
Joris Pelgröm 5d5e31e1cf
Update Wear OS companion app packages (#2766) 2022-08-06 13:02:26 -04:00
Daniel Shokouhi cc68946026
Add fragment dependency to resolve settings view model crashes (#2764) 2022-08-05 01:25:19 +00: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
Daniel Shokouhi 06b3dd386f
Update change log for week of 8/3 (#2756) 2022-08-04 15:55:35 -07: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
dependabot[bot] d4f7f84f1d
Bump sentry-android from 6.3.0 to 6.3.1 (#2759)
Bumps [sentry-android](https://github.com/getsentry/sentry-java) from 6.3.0 to 6.3.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/6.3.0...6.3.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-08-04 18:12:54 -04:00
dependabot[bot] cffb397ffc
Bump accompanist-appcompat-theme from 0.23.1 to 0.25.0 (#2719)
Bumps [accompanist-appcompat-theme](https://github.com/google/accompanist) from 0.23.1 to 0.25.0.
- [Release notes](https://github.com/google/accompanist/releases)
- [Commits](https://github.com/google/accompanist/compare/v0.23.1...v0.25.0)

---
updated-dependencies:
- dependency-name: com.google.accompanist:accompanist-appcompat-theme
  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:01:39 -04:00
Daniel Shokouhi c717e16afc
Update geocode location sensor with location updates that are sent to HA (#2757)
* Actually update geocoded sensor on location updates we send to HA

* Ensure sensor is updated before checking if we should send the update

* Move update logic to sensor receiver, ensure last sent attributes are updated
2022-08-04 18:00:07 -04:00
Daniel Shokouhi a6341251ea
Add a notification command to stop TTS (#2740) 2022-08-03 18:08:16 -04:00
Daniel Shokouhi 67d77d3b89
Restart location updates if we detect too much time passed since last update (#2732)
* Restart location updates if we detect too much time passed since last update

* Switch to last location received for proper evaluation

* Code review: move variable logic to be inside the condition
2022-08-03 18:07:11 -04:00
Joris Pelgröm 7953f81b95
Fix websocket stays subscribed after widget edit due to multiple instances (#2753)
* Fix websocket stays subscribed after widget edit due to multiple instances

 - When a widget is edited, the system will send a broadcast to _a new instance_ of the widget class. Because there is a websocket connection to keep widgets updated, the new instance of the class should also receive events to unsubscribe.

* Use companion object to prevent unnecessary updates

 - Only actually start listening for updates in one of the instances in order to prevent unnecessary duplicate widget updates
2022-08-03 18:04:50 -04:00
Daniel Shokouhi c543aff9eb
Switch to non-deprecated method to get FCM token during registration resync (#2752) 2022-08-03 18:03:30 -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
Daniel Shokouhi d7aeb582bb
Make sure to fallback to background updates when disable is selected in high accuracy notification (#2746)
* Make sure to fallback to background updates when disable is selected in notification

* Review comment
2022-08-03 18:01:45 -04:00
Daniel Shokouhi db0ddf25c2
Actually check the paired state instead of assuming it for bluetooth connection sensor (#2738)
* Actually check the paired state instead of assuming it

* Ensure the attributes have no duplicates by making the lists distinct

* Actually check for duplicate devices to remove them

* Apply code suggestion

* Revert some changes and remove allowDuplicates per comment
2022-08-03 18:01:21 -04:00
Daniel Shokouhi 8d57290314
Add support for lock domain in QS tiles and other improvements (#2737)
* Add support for lock domain in QS tiles, change tile not setup message to be more precise

* Update dispatcher

* Review comments: Remove not setup from string, only get state if domain is lock when tile is clicked

* Remove duplicate strings
2022-08-03 18:01:13 -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
Márton Maráz 7f1677a2dd
Fix Last Notification sensor not updating when notification is repeated with the same content (#2734)
Make Sensor::lastSentState and lastSentIcon nullable, set them to null when forceUpdate = true, and make null their default value everywhere.
2022-08-03 17:58:23 -04:00
Daniel Shokouhi 90a9a27e5e
Update changelog for week of 7/21 (#2665)
* Update changelog for week of 7/9

* Add a few more changes

* Update changes for recent merges
2022-07-29 15:16:12 -07:00
Joris Pelgröm c7b4f229ec
Improve discovery reliability for some devices (#2718)
- Some devices (most notably Google Pixels) require manually requesting a multicast lock in order for DNS-SD to work reliably
2022-07-29 17:55:06 -04:00
Daniel Shokouhi d03eb74fa9
Improve logging and error messages during onboarding (#2716)
* Add logging in authentication fragment to print errors

* Expand error messages to contain more useful data

* Add error content to pop-up to provide more data to the user

* Show more descriptive onReceivedError message

* Ensure the correct messages are used

* Add changes from @jpelgrom to only show the error on the expected URL

* Add condition to onReceivedErrror as well
2022-07-29 17:51:44 -04:00
Joris Pelgröm 8ee0e14e12
Support downloading data URIs (#2715)
- Adds support for downloading data URIs
 - Redirect unsupported download requests to the browser (or other app that supports it)
2022-07-29 17:51:04 -04:00
Daniel Shokouhi 285adfa5ce
Allow UUID, Major and Minor to be changed via notification command (#2713)
* Allow UUID, Major and Minor to be achanged via notification command

* Ensure transmitter restarts and attributes are updated upon change
2022-07-29 17:49:38 -04:00
Daniel Shokouhi b7fc9bbcff
Use correct default value for update interval to avoid double registrations on cold start (#2712) 2022-07-29 17:48:35 -04:00
Daniel Shokouhi 4b123ef2cf
Fire an event when a notification is received (#2705)
* Add a tsetting to fire an event when a notification is received

* Add a toast message to visually notify about failure

* Remove setting and toast
2022-07-29 17:47:59 -04:00
Joris Pelgröm 1cf3506d4b
Automatically delete 'stale'/old widgets from database (#2702)
Automatically delete stale widgets from database

 - Automatically removes widgets that are no longer bound to the widget provider but that are still in the database -> 'stale'/old widgets will no longer cause unnecessary updates
2022-07-29 17:46:02 -04:00