Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latitude and longitude are not in drive_state #147

Open
HansKappert opened this issue Nov 1, 2023 · 3 comments
Open

latitude and longitude are not in drive_state #147

HansKappert opened this issue Nov 1, 2023 · 3 comments

Comments

@HansKappert
Copy link

HansKappert commented Nov 1, 2023

I ran
python3 menu.py

After logging in, this error is printed at the console:
File "/Users/Hans/Downloads/TeslaPy-master/menu.py", line 37, in show_vehicle_data coords = '%s, %s' % (dr['latitude'], dr['longitude']) KeyError: 'latitude'

in the response I see 'api_version': 67
This is all that is returned in drive_state:

image
@heraldb
Copy link

heraldb commented Nov 10, 2023

The is already a patch for the Elixir library: teslamate-org/teslamate@5058a6f

(so in fact you need to add "?endpoints=location_data" to the url)

@RichieB2B
Copy link

While the quick fix of 38ff7da probably works, it will show the location icon in the car whenever TeslaPy requests VEHICLE_DATA. IMHO it would be better to create a separate endpoint to specifically retrieve location data.

@robharman
Copy link
Contributor

robharman commented Dec 18, 2023

While the quick fix of 38ff7da probably works, it will show the location icon in the car whenever TeslaPy requests VEHICLE_DATA. IMHO it would be better to create a separate endpoint to specifically retrieve location data.

Submitted #153 to implement this suggestion, as well as adding another endpoint/method to get only basic vehicle data without location and config, or the other endpoints as I often find myself needing only the basics. If there's enough need for it, happy to create something more extensible that would allow selective additional endpoints to be queried through another method.

Though, maybe updating the default get_vehicle_data() may be a better idea. Set it to default to all endpoints, but if options are requested only query basic data and those endpoints perhaps?

Closing for additional testing, will resubmit and update comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants