You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed a bug which might be helpful in this case:
original code (line 1050 in Vehicle/TeslaAPI.py)
if isinstance(url, bytes):
url = url.decode("UTF-8")
code = re.search(r"code=(.+)&state=(.+)", url)
This assumes that after the "state" variable, nothing is there. But that was not the case for me. It had additinal parameters in it that got added as "state" later on and so the requests always failed. This regular expression has to optimized to skip additinal parameters. I also would suggest to change it in case the reply changes (state before code in URL).
There are sure better ways to write this, but as the value of the state parameter (i.e. code.group(2) as returned by re and written to the log) is never used, what difference does it make? Is there really an issue with saving the token? Might be something else then.
original code (line 1050 in Vehicle/TeslaAPI.py)
This assumes that after the "state" variable, nothing is there. But that was not the case for me. It had additinal parameters in it that got added as "state" later on and so the requests always failed. This regular expression has to optimized to skip additinal parameters. I also would suggest to change it in case the reply changes (state before code in URL).
Originally posted by @GMerg in #564 (comment)
The text was updated successfully, but these errors were encountered: