We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
First of all, thanks a lot for the great work on this package!
Despite calling check_and_force_update_vehicles(1) the vehicle data is always from the last cached point in time.
Tried various parameters for check_and_force_update_vehicles() including 0, 1, 60 and 600.
from hyundai_kia_connect_api import * import json import datetime vehicle_id = 'xxx' vm = VehicleManager(region=1, brand=1, username="xxx", password="xxx", pin="", language="de") vm.check_and_refresh_token() vm.check_and_force_update_vehicles(1) dict = vars(list(vm.vehicles.values())[0]) print(f"current time: {datetime.datetime.now()}") last_updated_at = dict["last_updated_at"] print(f"last updated at: {last_updated_at}")
The code above yields the following output (example):
d:\ python refresh_test.py current time: 2023-09-24 11:14:51.865252 last updated at: 2023-09-24 11:02:44+02:00
When I refresh the status in the KIA Connect app, the API returns the values from the moment, where the refresh command was issued in the app.
Am I doing something wrong? I'm pretty sure, this approach worked some weeks ago. How can I get current values using the API?
The text was updated successfully, but these errors were encountered:
Thanks to this comment #12 (comment) I realized that an additional call to update_all_vehicles_with_cached_state() is required. This code works now:
update_all_vehicles_with_cached_state()
vm.check_and_refresh_token() vm.force_refresh_all_vehicles_states() vm.update_all_vehicles_with_cached_state() dict = vars(list(vm.vehicles.values())[0]) print(f"current time: {datetime.datetime.now()}") last_updated_at = dict["last_updated_at"] print(f"last updated at: {last_updated_at}")
This now yields the expected behavior:
d:\>python refresh_test.py current time: 2023-09-29 21:20:05.338277 last updated at: 2023-09-29 21:20:04+02:00
Sorry, something went wrong.
No branches or pull requests
First of all, thanks a lot for the great work on this package!
Description
Despite calling check_and_force_update_vehicles(1) the vehicle data is always from the last cached point in time.
What I Did
Tried various parameters for check_and_force_update_vehicles() including 0, 1, 60 and 600.
The code above yields the following output (example):
d:\ python refresh_test.py
current time: 2023-09-24 11:14:51.865252
last updated at: 2023-09-24 11:02:44+02:00
When I refresh the status in the KIA Connect app, the API returns the values from the moment, where the refresh command was issued in the app.
Am I doing something wrong? I'm pretty sure, this approach worked some weeks ago.
How can I get current values using the API?
The text was updated successfully, but these errors were encountered: