Commit Graph

23 Commits

Author SHA1 Message Date
jlestel
4313409323 feat: Dynamic endpoints and token to use official Tesla API (self-hosted or from third party provider) (#3903)
* feat: endpoints by env

* fix: typo

* fix: useless env

* fix: format

* fix: distinct auth domain and url

* format

* fix: force issuer url if needed

* feat: new streaming based on vin

* fix refresh

* revert

* up

* feat: no need for access token / refresh token if the TOKEN env var is present

* feat: update login if token env var exists

* feat: add ENV var to allow insecure wss

* fix: remove TESLA_CN

* fix(naming): TESLA_API_URL to TESLA_API_DOMAIN

* feat: add an env var to allo invalid certs on WSS

* doc: add API domains env vars description

* fix: typo

* feat: add env var to change log level

* fix: APP_LOG_LEVEL

* feat: add TOKEN documention and wording

* fix: refacto insecure param

* feat: naming and doc

* fix: missing env var usage

* fix: rebound variable issuer_url

* fix: compilation warning on the issuer_url variable

* fix: format code

* fix: issuer_url assignments

---------

Co-authored-by: Julien <julien@citio.digital>
2024-05-27 11:03:23 +02:00
Jakob Lichterfeld
10995a3ce5 Revert "Dynamic endpoints and token to use official Tesla API (self-hosted or from third party provider) (#3866)"
This reverts commit 263f207dc9.
2024-05-20 14:07:26 +02:00
jlestel
263f207dc9 Dynamic endpoints and token to use official Tesla API (self-hosted or from third party provider) (#3866)
* feat: endpoints by env

* fix: typo

* fix: useless env

* fix: format

* fix: distinct auth domain and url

* format

* fix: force issuer url if needed

* feat: new streaming based on vin

* fix refresh

* revert

* up

* feat: no need for access token / refresh token if the TOKEN env var is present

* feat: update login if token env var exists

* feat: add ENV var to allow insecure wss

* fix: remove TESLA_CN

* fix(naming): TESLA_API_URL to TESLA_API_DOMAIN

* feat: add an env var to allo invalid certs on WSS

* doc: add API domains env vars description

* fix: typo

* feat: add env var to change log level

* fix: APP_LOG_LEVEL

* feat: add TOKEN documention and wording

* fix: refacto insecure param

* feat: naming and doc

* fix: missing env var usage

---------

Co-authored-by: Julien <julien@citio.digital>
2024-05-20 13:11:13 +02:00
Michael Vestergaard
1857f25d0f Handle stream getting the message "Vehicle is offline" and change the state to offline in vehicle (#3508) 2024-01-19 14:09:59 +01:00
Adrian Kumpf
db59717d04 Fix deprecation warnings on Elixir v1.15 2023-06-10 18:44:18 +02:00
Adrian Kumpf
8756c66bca Fix typos 2023-02-03 21:20:10 +01:00
Adrian Kumpf
b209d348f8 Restart stream process if token expired
Addresses #2450
2022-02-20 14:18:00 +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
cbf8d8922d Handle unexpected SSL messages
Closes #2001
2021-09-28 17:19:02 +02:00
Adrian Kumpf
6c19a7b8a7 Handle owner_api errors returned by streaming API
Addresses #1848
2021-07-19 15:12:09 +02:00
Adrian Kumpf
6f6dc0ae3f Use latset websockex 2021-03-20 21:38:42 +01:00
Adrian Kumpf
2b4d774b06 Change log level for streaming timeouts to debug 2021-02-06 17:32:00 +01:00
Ahrr Jay
c104f9975e Fix typo in connection (#1009) 2020-10-14 12:30:43 +02:00
Adrian Kumpf
4b23c8604e Upgrade to Elixir v1.11 2020-10-08 22:17:56 +02:00
Adrian Kumpf
9311cb4171 Create new connection after too many disconnects 2020-07-08 20:01:28 +02:00
Adrian Kumpf
9c74846432 Tweak streaming timeouts 2020-06-29 17:45:27 +02:00
Adrian Kumpf
9cbc12ab51 Differentiate between vehicle and unknown errors 2020-04-08 11:13:43 +02:00
Adrian Kumpf
71f02dab66 Do not warn if terminating with :normal 2020-04-02 16:32:30 +02:00
Adrian Kumpf
68c32ff2af Use exponential backoff 2020-04-01 19:34:57 +02:00
Adrian Kumpf
cd702765e4 Reconnect in case of a connection error 2020-04-01 13:23:27 +02:00
Adrian Kumpf
38893db700 Prevent that more than one request is made at the same time 2020-03-28 15:52:35 +01:00
Adrian Kumpf
a691784926 Use the Streaming API
Closes #417
2020-03-28 15:52:35 +01:00