Closed hafley closed 1 year ago
Please change last context manager to:
with teslapy.Tesla(email) as tesla:
vehicles = tesla.vehicle_list()
print(vehicles[0].api("FETCH_VEHICLE_SHARE_INVITES"))
If you call api() on the vehicle object, the vehicle_id is added automatically.
invite.py
Terminal output:
Traceback (most recent call last):
File "invite.py", line 25, in
tesla.api(endpoint,vehicle_dict)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/teslapy/init.py", line 363, in api return self.request(endpoint['TYPE'], uri, serialize, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/teslapy/init.py", line 155, in request response.raise_for_status() # Raise HTTPError, if one occurred ^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: not_found for url: https://owner-api.teslamotors.com/api/1/vehicles/265113217424/invitations