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

Fix additional server error problem #125

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

olalid
Copy link

@olalid olalid commented Mar 24, 2024

An additional problem was found that also affects the internal server error status.

@leeyuentuen
Copy link
Contributor

i think this is wrong. because evdata is normally from v1 api

@olalid
Copy link
Author

olalid commented Mar 24, 2024

Well, I do not agree.
get_ev_data fetches the data by calling _get_odometer_data and _get_battery_data which uses the V2 URL.
Problem is I guess that get_ev_data also potentially calls get_token when the token needs to be refreshed which uses the V1 URL.
So I guess this is a too simple way to fix it, although it does help since "almost" every time that get_ev_data is called it calls a V2 API.
Question is, is it really necessary to keep separate "call_code" for V1 and V2 API?
Could we just consolidate them in to one to get rid of this problem?

@leeyuentuen
Copy link
Contributor

i need to check then. but v1 is only the car data, v2 is de battery and odo data

why separate? we can't get the car data in v2

@olalid
Copy link
Author

olalid commented Mar 24, 2024

I meant why separate lastest_call_code.
(I.e. not why use both APIs).

@leeyuentuen leeyuentuen merged commit c4357d1 into pypolestar:dev Mar 29, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants