Commit Graph

644 Commits

Author SHA1 Message Date
Adrian Kumpf
4931217ca7 Update Elixir dependencies 2023-01-13 11:02:14 +01:00
Adrian Kumpf
a413e8ce2c Add setting to select tire pressure units 2022-07-18 11:35:14 +02:00
Adrian Kumpf
2b3e127259 Handle invalid JWTs 2022-07-15 12:35:35 +02:00
Brian May
4a11ef8421 If no geofence is found map then use default value (#2564)
This is required because the default value is "" which tells the mqtt
server to delete the retained value.

This in turn means that applications that care about when the car is in
a unknown location will not get the retained value.

This is a bit different from all of the other values in
`@always_published`. For them "" is only published if the value is
unknown or an error occurred. So it makes sense to delete the retained
value.

In this case however, a value of "" generally means "the car is outside
any known geofence" which is a valid condition it itself, and it should
be retained.

There was speculation this might affect the shift_state, but
unfortunately this was not followed up with any evidence or details. #1912

There are any number of solutions that could be deployed here. The
advantage of this solution however is it is not going to break anything
unless you specifically define the TESLAMATE_DEFAULT_GEOFENCE variable.

Fixes: #1336
2022-07-15 10:59:46 +02:00
NirKli
7a9c6b9ad1 Added tire pressure (#2706)
* - Added support for tire pressure graph per drive

* - Fixed migration script

* - Added tire pressure documentation in mqtt.md

* Use add command instead of add_if_not_exists

Co-authored-by: Adrian Kumpf <8999358+adriankumpf@users.noreply.github.com>

* Remove drop function command from migration script

Co-authored-by: Adrian Kumpf <8999358+adriankumpf@users.noreply.github.com>

* Format code

Co-authored-by: Adrian Kumpf <8999358+adriankumpf@users.noreply.github.com>
2022-06-24 15:24:39 +02:00
Adrian Kumpf
a0e12c3808 Store marketing names
... and identify new Model S and X.

Closes #2494, #2496
2022-04-22 15:42:25 +02:00
Adrian Kumpf
7d2a841f1f Bump deps 2022-04-04 14:24:04 +02:00
Adrian Kumpf
b209d348f8 Restart stream process if token expired
Addresses #2450
2022-02-20 14:18:00 +01:00
Adrian Kumpf
bbdc2d25ae Move encryption key warning into .container 2022-02-18 17:21:16 +01:00
Adrian Kumpf
0d6e288c70 Encrypt API tokens (#2360)
Store API tokens encrypted in the database.

During the database migration a randomly generated key will be used encrypt the tokens if no ENCRYPTION_KEY environment variable was provided.

If the application is started without the presence of an ENCRYPTION_KEY (or if the key failed to decrypt the existing tokens), the UI will display a warning with further instructions.
2022-02-18 17:03:13 +01:00
Adrian Kumpf
a8bcb906b1 Add charge_current_request(_max) MQTT topics
Implements #2412
2022-02-09 17:13:35 +01:00
cwanja
c89088f7d6 Update vehicle.ex (#2455)
Added support for the 2021.5+ Model X. Fixes #2454
2022-02-09 16:01:01 +01:00
cwanja
66254de906 Update summary.html.heex (#2390)
* Update summary.html.heex

Create a link on the summary page to link to Not a Tesla App release notes page per discussion request #2367 

Full disclosure - not proficient in Elixir, but understand HTML and capable of digging through other code and comparing. Just not sure how the `@summary.version` is going to be treated in the link text.

* Fix string interpolation

* Update tests

Co-authored-by: Adrian Kumpf <8999358+adriankumpf@users.noreply.github.com>
2022-01-28 12:16:17 +01:00
Adrian Kumpf
b6a5219090 Don't exchange SSO token for Chinese accounts
Addresses #2378
2022-01-26 18:03:56 +01:00
Adrian Kumpf
d6d4d62ac7 Skip unnecessary locale downloads 2022-01-23 23:57:24 +01:00
Adrian Kumpf
25e572bb9b Don't warn in case of common faulty update status
After successfully installing an update the Tesla API often reports
"downloading" as `status` while `install_perc` is at 100%.
2022-01-22 13:03:48 +01:00
Adrian Kumpf
6c53788738 Don't suspend logging while downloading an update
Fixes #2194
2022-01-22 13:00:50 +01:00
James Bogosian
963831deee Enable zoom on live view of the car. (#2184)
* Enable zoom on live view of the car.

* Switch to using drag/pinch-to-zoom/scroll-to-zoom

* Remove data-zoom attrbiute as parameters are directly set in the JS.

* Directly set parameters for zoom instead of relying on attribute from DOM.

* Switch to use hover/tap to show/hide zoom control.
2022-01-21 19:28:20 +01:00
Adrian Kumpf
8aa772872a Remove support for logins with username/password 2022-01-21 19:09:32 +01:00
Adrian Kumpf
3d1697a909 Don't parse issuer URL twice 2022-01-19 10:12:25 +01:00
Howard Su
811dac1d08 Fix MFA for Chinese accounts (#2234) 2022-01-01 18:04:13 +01:00
Adrian Kumpf
3fb0d2f8d0 Guard against duplicate vehicle responses
Addresses #2230
2022-01-01 17:29:36 +01:00
Adrian Kumpf
b4ad1ff2cd Remove unnecessary id attributes 2022-01-01 17:29:36 +01:00
Adrian Kumpf
2c3e8e0560 Revert "Use built-in get_in/2"
This reverts commit e53bdc1784.

Due to a bug with Elixir < 1.13 the built-in get_in/2 handles nil values
incorrectly.
2021-12-14 15:31:32 +01:00
Adrian Kumpf
fc2b188a31 Fix detection of refreshed Model S
Addresses #2193
2021-12-14 15:16:54 +01:00
Adrian Kumpf
e53bdc1784 Use built-in get_in/2 2021-12-13 19:40:43 +01:00
Adrian Kumpf
5113bc3c52 Update Chinese endpoints 2021-12-13 19:30:04 +01:00
Adrian Kumpf
977f423014 Use new Chinese endpoints
Related to #2214
2021-12-13 19:08:22 +01:00
Adrian Kumpf
0a127f60a9 Show error message if access is denied
Related to #2159
2021-11-17 17:39:28 +01:00
Adrian Kumpf
1992af38c3 Show token sign-up form by default 2021-11-12 17:39:20 +01:00
Adrian Kumpf
628b6f0a4c Fix locale detection
Fixes #2141
2021-11-12 17:02:29 +01:00
Adrian Kumpf
bbf328ce9e Increase timeout
Related to #2136
2021-11-09 18:04:12 +01:00
Adrian Kumpf
451b23634c Sign out if API repeatedly returns 401 response 2021-11-05 18:53:50 +01:00
Adrian Kumpf
5a9da881b4 Force locale download only in :prod 2021-11-05 17:21:43 +01:00
dependabot[bot]
9509ccde76 Bump ex_cldr from 2.23.2 to 2.24.1 (#2121)
* Bump ex_cldr from 2.23.2 to 2.24.1

Bumps [ex_cldr](https://github.com/elixir-cldr/cldr) from 2.23.2 to 2.24.1.
- [Release notes](https://github.com/elixir-cldr/cldr/releases)
- [Changelog](https://github.com/elixir-cldr/cldr/blob/master/CHANGELOG.md)
- [Commits](https://github.com/elixir-cldr/cldr/compare/v2.23.2...v2.24.1)

---
updated-dependencies:
- dependency-name: ex_cldr
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Replace custom PutSession plug

* Bust cldr chache

* Bump phoenix_live_view and tzdata

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Adrian Kumpf <8999358+adriankumpf@users.noreply.github.com>
2021-11-05 17:19:37 +01:00
herbit
b1b53654e5 Added Apple mobile web app capable meta tag (#2128)
Enable to run the website in full screen mode on iPhones. This is useful in combination when starting TeslaMate with an app icon from the home screen.
2021-11-05 17:08:43 +01:00
Adrian Kumpf
9c9564ecc7 Exchange Chinese SSO tokens 2021-10-31 16:56:36 +01:00
Adrian Kumpf
1425f82b49 Update dependencies 2021-10-31 16:18:23 +01:00
Adrian Kumpf
4c7daa9f03 Use BIGINT for elapsed seconds
Related to #2077
2021-10-22 12:32:06 +02:00
Adrian Kumpf
a4e7eb7159 Add Model Y friendly_name 2021-10-15 12:45:35 +02:00
Ricky Romero
37a3adb397 Add Mid-Range Model 3 (#2057) 2021-10-15 12:35:37 +02:00
Adrian Kumpf
6c0c0eeaa9 Display marketing names
Related to #2030
2021-10-06 12:25:18 +02:00
Adrian Kumpf
0d92c9757b Reduce token refresh frequency 2021-10-01 11:45:43 +02:00
Adrian Kumpf
00ce5c39ce Use SSO Access Tokens 2021-09-30 13:45:02 +02:00
Adrian Kumpf
ec8b604c00 Discard stale stream data when falling asleep 2021-09-29 19:25:29 +02:00
Adrian Kumpf
cbf8d8922d Handle unexpected SSL messages
Closes #2001
2021-09-28 17:19:02 +02:00
Adrian Kumpf
e4f0cb9767 Unify wording 2021-09-27 19:19:27 +02:00
Adrian Kumpf
1feb844e2f Discard stale stream data
Related to #1996
2021-09-27 19:05:26 +02:00
Adrian Kumpf
a4304c2915 Add debug log statements
Related to #1996
2021-09-27 18:28:22 +02:00
Adrian Kumpf
4ea3034202 Broadcast offline state when car goes offline while driving
Fixes #1975
2021-09-22 22:26:36 +02:00