Commit graph

780 commits

Author SHA1 Message Date
chriss158 42ed8928dd
Rework high accuracy location service (#1455)
* Rework high accuracy location service

* Better translation for unkown address

* Fix unknown sensor state

* Simplify prettyAddress condition
2021-03-28 14:40:18 -04:00
Daniel Shokouhi 675a21be12
Make service field description optional to match core integrations (#1458) 2021-03-28 13:10:33 -04:00
Daniel Shokouhi eb3629181e
Use service call provided action title for reply actions (#1457) 2021-03-28 13:08:50 -04:00
Daniel Shokouhi 2d7e9e85fa
Add debug logs to troubleshoot URL switching (#1454) 2021-03-28 13:07:39 -04:00
Daniel Shokouhi 1106828d3b
Add battery temperature sensor (#1453) 2021-03-28 13:06:15 -04:00
chriss158 90af58977d
Fix clear_notification if notifications are in the auto group (#1452)
* Fix clear_notification if notifications are in the auto group

* Add better detection if auto group is used
2021-03-28 13:04:48 -04:00
Daniel Shokouhi 724e2a0fcd
Add some debug logs for next alarm sensor update logic (#1451)
* Add some debug logs for next alarm sensor update logic

* Lint
2021-03-28 12:56:36 -04:00
uvjustin 960db328ed
Update exoplayer to r2.13.2 (#1448)
* Update exoplayer to r2.13.2

* Add trailing newline

* Build media source implicitly

* Use 4x4 layout grid

* Remove unused dataSourceFactory and imports
2021-03-28 12:53:46 -04:00
Daniel Shokouhi 614e2de843
Open the more info controls on entities when long pressed in android 11 power menu (#1446) 2021-03-28 12:52:12 -04:00
chriss158 754d37849c
Fix statusbar color (#1431)
* Fix statusbar color when theme is not set in backend

* Fix crash setting color

* Fix lint

* Set statusbar color from event bus

* Fix lint
2021-03-28 12:46:59 -04:00
chriss158 9070ddb346
Improve location tracking on non GPS devices (#1426)
* Improve location tracking on non GPS devices

* Fixed crash enabling location from DisabledLocationHandler on Amazon devices (Non-GPS)
* Disable single accurate location sensor on non GPS devices
* Fixed enabled location tracking after onboarding even if location tracking was disabled
* Open settings, if location settings can't be opend (ex. Custom-ROM without GAPPS)

* Fix that the default setting does not set location sensors

* Do not enable singleAccurateLocation sensor if device has no GPS

* Make use availableSensors to hide singleAccurateLocation sensor

* Fix lint

* Fix disabling of singleAccurateLocation sensor on devices with GPS

* Enable all sensors while onboarding

* Fix code indentation
2021-03-28 12:35:50 -04:00
chriss158 3639d42937
Fix broken database migration (#1445) 2021-03-22 21:27:19 -04:00
chriss158 e197e86044
Add additional logging for MessagingService and NotificationManagerExtensions (#1442)
* Add additional logging for MessagingService and NotificationManagerExtensions

* Fix lint
2021-03-22 13:26:15 -04:00
Daniel Shokouhi 8da4a6df25
Ensure blurView is off when we are unlocked with a timeout (#1434) 2021-03-22 13:23:12 -04:00
chriss158 a24c36875e
Enable high accuracy mode when entering zone (#1415)
* Enable high accuracy mode when entering zone

Additional changes:
* Added possibility to enable/disable a sensor setting which will be displayed accordingly in the settings.
* Refactored "creating a list setting" into a method createListPreference
* Fire HA Event for every Zone Entered/Exited and not only for the first

* Fix compile errors after merge upstream

* Unify the use of expression geozone to zone

* High accuracy mode - use OR connected constraints

* Constraint were AND connected. Both constraints (if used) needed to apply
Now the are OR connected. One constraint need to apply.

* Rename setting "High accuracy mode zone expanded radius" to "High accuracy mode trigger range for zone"

* Default range is set to 300 meters, therefore the expanded zones are used

* Make conditions better readable
2021-03-22 12:55:14 -04:00
Daniel Shokouhi eba8f15530
Switch to a different method to get alarm ringtone, default to normal ringtone if alarm is null (#1428) 2021-03-11 15:43:51 -05:00
Daniel Shokouhi 79c3de84b4
Bump some dependencies (#1424) 2021-03-11 15:40:31 -05:00
Daniel Shokouhi 9f31f54249
Prevent converting NaN values in pressure sensor (#1423) 2021-03-11 15:38:11 -05:00
Daniel Shokouhi 4dc3297a4c
Fix out of bounds exception in field adapter (#1422)
* Fix out of bounds exception in field adapter

* Use doAfterTextChanged to clean up per code review
2021-03-11 15:35:08 -05:00
Daniel Shokouhi 04ff1dd360
Only get the state of importance if we have running processes (#1421) 2021-03-11 15:31:02 -05:00
Daniel Shokouhi 640e83d54c
Catch crash when activity can't start due to missing default browser (#1420) 2021-03-11 15:26:54 -05:00
Justin Bassett 36281bfdc4
Don't use empty translations. (#1419) 2021-03-11 15:20:25 -05:00
Daniel Shokouhi f38ec600e3
Use a custom user agent string to avoid being blocked (#1418) 2021-03-10 15:37:10 -05:00
Daniel Shokouhi 90b9c52540
Fix blank title for authenticator (#1416)
* Fix blank title for authenticator

* Review comments
2021-03-10 15:33:29 -05:00
Alfiegerner d971d50941
Add BLE Transmitter setting to turn on / off transmitter. (#1413)
* Add BLE Transmitter setting to turn on / off transmitter.  Notification command will now toggle the transmitter and this setting, if the sensor is enabled.

* Change setting names they're ordered correctly.  This is a slight breaking change, as people previously stored IDs will neeed to be re-added.

* Revert 'id' from labels.
2021-03-09 17:06:32 -05:00
Daniel Shokouhi 588fc61d0c
Save widget states so we can restore them when calls fail (#1412)
* Save widget states so they can be restored if the update call fails

* Fix db crash
2021-03-08 09:57:56 -05:00
Nelson Osacky d4b5819693
Bump versions, Kotlin, Gradle, etc. (#1411) 2021-03-08 09:03:32 -05:00
Daniel Shokouhi 6109ce466c
Prevent crash when removing default channel (#1405) 2021-03-08 09:00:42 -05:00
Daniel Shokouhi 94a86de4d5
Allow retry attempts for biometric prompt, enable skip confirmation for faster access (#1404) 2021-03-08 08:57:48 -05:00
Daniel Shokouhi 46b0b87e59
Restore night theme (#1403)
* Restore night theme

* Don't pull translations on PR.

Co-authored-by: Justin Bassett <bassett.justint@gmail.com>
2021-03-05 14:25:28 -05:00
Daniel Shokouhi 23a7e54d60
Add a link during onboarding for new users (#1399) 2021-03-05 10:48:55 -05:00
Justin Bassett 3863bace50
Pull translations at build time (#1397)
* First attempt at pulling Lokalise at build time.

* Temporarily download in PRs.

* Remove null outputs

* Double quotes?

* Oops.

* Forgot the `inputs.`

* Don't override files (aka English).

* Override files when extracting...

* Put args on correct command.

* Now that it works remove push action.

* Fix copy pasta.
2021-03-05 10:37:49 -05:00
Home Assistant Bot c6fff9216d
Lokalise: updates (#1394) 2021-03-03 09:55:59 -05:00
Bram Kragten d66c568d98
Make sure we don't get double / (#1393) 2021-03-03 09:46:28 -05:00
Justin Bassett 65ee3689ea
Fix potential issue with homeassistant://navigate/ handling. (#1392) 2021-03-02 23:06:18 -05:00
Daniel Shokouhi 6884813e14
Add new sleep sensors for new sleep API (#1387)
* Add new sleep sensors for new sleep API

* Only register for requested updates

* Review comments

* Add more loggers, fix registration issue

* Send classify events as soon as we get them since they come frequently compared to segments which are very infrequent

* Add unit of measurement to sensors
2021-03-02 22:49:23 -05:00
Bram Kragten b9b7805cfa
Fix URL handling (#1389) 2021-03-02 21:24:25 -05:00
Justin Bassett 12ce3eebda
Add my.home-assistant.io support (#1379)
* Initial commit of my.home-assistant.io support.

* ktlint

* Add `homeassistant://navigate/*` support.

* Only debug webview on debug builds.
2021-03-01 09:45:17 -05:00
Alfiegerner e12c6e38b1
Small BLE Transmitter enhancement, handle Bluetooth state changes better, improve robustness (#1384)
* First cut add BLE beacon as new sensor.

* Lint issues, also using hardcoded strings for state.

* Fixes and small tidies following review.

* Add command_ble_transmitter to MessagingService.kt, to control BLE Transmitter from HA notifications.

* Make description more specific for settings.

* Return if sensor not enabled

* Spaced.

* Command turn on for transmitter should stop it first, as state could be incorrect on Bluetooth being disabled.

* Don't attempt to transmit if BT is off, and include that information in the state.

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

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

* Add 2 new settings:
  - Power transmitter values between high and ultra low.  Defaults to ultra low, should help with Battery concerns
  - A setting which allows the sensor to be turned on by default when the Enable all toggle is turned on.  This is off by default, users have to actively seek out this sensor to turn it on.

* Add battery warning to description.

* Fix build - stray merge comma deletion.

* Fix small description text error.

* Fix left notification when high accuracy mode was disabled (#1366)

Some points which may fix this issue
* Make notification objects static
* Use ServiceCompat for stopForeground
* Additionally call cancel to remove notification

* Bump some app dependencies (#1374)

* Add BLE ibeacon transmitter as sensor to allow room presence. (#1343)

* First cut add BLE beacon as new sensor.

* Lint issues, also using hardcoded strings for state.

* Fixes and small tidies following review.

* Add command_ble_transmitter to MessagingService.kt, to control BLE Transmitter from HA notifications.

* Make description more specific for settings.

* Return if sensor not enabled

* Spaced.

* Command turn on for transmitter should stop it first, as state could be incorrect on Bluetooth being disabled.

* Don't attempt to transmit if BT is off, and include that information in the state.

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

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

* Add 2 new settings:
  - Power transmitter values between high and ultra low.  Defaults to ultra low, should help with Battery concerns
  - A setting which allows the sensor to be turned on by default when the Enable all toggle is turned on.  This is off by default, users have to actively seek out this sensor to turn it on.

* Add battery warning to description.

* Fix build - stray merge comma deletion.

* Fix small description text error.

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

* And fix service fields being added too many times (#1377)

* Improve robustness when BT is turned on and off. Also, tidy code, keep sense of when device parameters have changed in one place.

Co-authored-by: Justin Bassett <bassett.justint@gmail.com>
Co-authored-by: chriss158 <edgi@arcor.de>
Co-authored-by: Daniel Shokouhi <dshokouhi@gmail.com>
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2021-03-01 09:29:49 -05:00
Daniel Shokouhi 754ef83b25
Convert intent extras to a string so they can be sent without error (#1386) 2021-03-01 09:25:07 -05:00
Bram Kragten 5aac90d597
And fix service fields being added too many times (#1377) 2021-02-25 21:15:05 -05:00
Alfiegerner e2783a8cec
Add BLE ibeacon transmitter as sensor to allow room presence. (#1343)
* First cut add BLE beacon as new sensor.

* Lint issues, also using hardcoded strings for state.

* Fixes and small tidies following review.

* Add command_ble_transmitter to MessagingService.kt, to control BLE Transmitter from HA notifications.

* Make description more specific for settings.

* Return if sensor not enabled

* Spaced.

* Command turn on for transmitter should stop it first, as state could be incorrect on Bluetooth being disabled.

* Don't attempt to transmit if BT is off, and include that information in the state.

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

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

* Add 2 new settings:
  - Power transmitter values between high and ultra low.  Defaults to ultra low, should help with Battery concerns
  - A setting which allows the sensor to be turned on by default when the Enable all toggle is turned on.  This is off by default, users have to actively seek out this sensor to turn it on.

* Add battery warning to description.

* Fix build - stray merge comma deletion.

* Fix small description text error.

Co-authored-by: Justin Bassett <bassett.justint@gmail.com>
2021-02-25 21:09:37 -05:00
Daniel Shokouhi 03219b8eb8
Bump some app dependencies (#1374) 2021-02-25 21:04:07 -05:00
chriss158 23c6005bcc
Fix left notification when high accuracy mode was disabled (#1366)
Some points which may fix this issue
* Make notification objects static
* Use ServiceCompat for stopForeground
* Additionally call cancel to remove notification
2021-02-25 20:48:52 -05:00
Justin Bassett 7582fdecbf
Disable failing lint in Github. (#1378) 2021-02-25 20:40:58 -05:00
Justin Bassett 5bbfde42b1
Add some logging to release note generator. (#1370)
* Add some logging to release note generator.

* Add release note generation to PR builds.

* Update fetch depth.

* Remove command that is failing randomly...
2021-02-21 22:03:16 -05:00
Home Assistant Bot 4ea4c1a223
Lokalise: updates (#1362) 2021-02-14 09:59:46 -05:00
Daniel Shokouhi 91fcd5b92b
Map dpad down key to tab key in webviews (#1358) 2021-02-12 14:40:06 -05:00
Daniel Shokouhi 10d5f7c725
Try the other URL when refreshing webview on a connection error (#1287)
* Try the other URL when refreshing webview on a connection error

* Update refresh button to reflect the URL to be used

* Fix label to only change if user is internal

* Fix failing test
2021-02-12 14:34:30 -05:00
Daniel Shokouhi 93efa8999c
Log webview package and version (#1360) 2021-02-12 14:29:36 -05:00