diff --git a/etc/twcmanager/config.json b/etc/twcmanager/config.json index 7d97caf1..e0bf9189 100644 --- a/etc/twcmanager/config.json +++ b/etc/twcmanager/config.json @@ -149,7 +149,7 @@ # See https://github.com/teslamotors/vehicle-command # # The URL of the Tesla HTTP Proxy running locally - # "teslaProxy": "https://localhost:4443" + # "teslaProxy": "https://localhost:4443", # # Only set "teslaProxyCert" when "teslaProxy" is set. #"teslaProxyCert": "/path/to/public_key.pem", diff --git a/lib/TWCManager/Vehicle/TeslaAPI.py b/lib/TWCManager/Vehicle/TeslaAPI.py index a0e4cdcc..aef554b4 100644 --- a/lib/TWCManager/Vehicle/TeslaAPI.py +++ b/lib/TWCManager/Vehicle/TeslaAPI.py @@ -9,7 +9,6 @@ import time from urllib.parse import parse_qs import jwt -import datetime logger = logging.getLogger("\U0001F697 TeslaAPI") @@ -1113,8 +1112,7 @@ def setCarApiBearerToken(self, token=None): if not self.baseURL: decoded = jwt.decode( token, - options={"verify_signature": False, "verify_aud": False}, - leeway=datetime.timedelta(days=300), + options={"verify_signature": False, "verify_aud": False, "verify_exp": False}, ) if "owner-api" in "".join(decoded.get("aud", "")): self.baseURL = self.regionURL["OwnerAPI"] diff --git a/requirements.txt b/requirements.txt index ac6a9371..27141367 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,6 +10,7 @@ pymodbus>=3.0.0; python_version >= '3.8' pyModbusTCP>=0.1.8 pymysql pyserial>=3.4 +PyJWT PyYAML requests>=2.23.0 sentry_sdk>=0.11.2 @@ -18,4 +19,3 @@ sysv_ipc termcolor>=1.1.0 websockets<=9.1; python_version == '3.6' websockets>=9.1; python_version >= '3.7' - diff --git a/setup.py b/setup.py index 2514360a..2f0eec3e 100755 --- a/setup.py +++ b/setup.py @@ -18,6 +18,7 @@ "ocpp", "paho_mqtt>=1.5.0", "psycopg2", + "pyjwt", "pyModbusTCP>=0.1.8", "pymysql", "pyserial>=3.4",