fix(api): fixes for tesla 20.49 API changes #15
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the 20.49 firmware update by Tesla, the endpoints that previously
were open are no longer without authentication. Unfortunately, the
mechanism used for authentication is not HTTP basic, rather it's cookie
based. This makes it so a process runs in the background to ensure that
you always stay logged in and then executes the queries against the
endpoints with the login cookie.
However, for some reason cURL was just ignoring the cookie file on my
machine, so I had to do some extra hacks to make it pass the cookies in
on the command line. Also, this requires cron, which means by that point
I might as well build a new docker container for this process.
I should say - this is NOT something that I'm super proud of - in particular,
I'm really annoyed with the fix for the cookies and cURL, but it works.
Now, here's the major caveat: because most of the things have switched from
http
toexec
this breaks previous records in the database.As I'm writing this, I realize there might be an approach where we can implement
a very simple proxy to make it so fewer changes are necessary.