kia_uvo
kia_uvo copied to clipboard
KeyError: 'calculativeOdo' since latest update
Region and Brand of car KIA Sportage - Europe
Version of the integration V2.22.0
Describe the bug There are bugs reported in the log (see below)
Debug logs if an error occurred
Logger: hyundai_kia_connect_api.KiaUvoApiEU
Source: /usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py:362
First occurred: 17:04:54 (4 occurrences)
Last logged: 19:05:27
Failed to parse driving info. Possible reasons: - incompatible vehicle (ICE) - new API format - API outage
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 357, in update_vehicle_with_cached_state
state = self._get_driving_info(token, vehicle)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 1382, in _get_driving_info
and drivingInfoItem["calculativeOdo"] > 0
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'calculativeOdo'
To Reproduce Reported after each update with data from car
What year of car? Is it a phev?
Car build 2023 and it is a phev
Hi @cdnninja , I have added some debug information. Maybe this helps.
Does native app show driving stats?
Is this what you're looking for?
Seeing the same error with my PHEV, and only since last update.
+1.
Perhaps this https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api/blob/31182c658d7638ac37524f4f08590a4ac42068f0/hyundai_kia_connect_api/KiaUvoApiEU.py#L1382C21-L1382C62
if (
drivingInfoItem["drivingPeriod"] == 0
and drivingInfoItem["calculativeOdo"] > 0
):
can be changed to:
if (
drivingInfoItem["drivingPeriod"] == 0
and next((v for k, v in drivingInfoItem.items() if k.lower() == "calculativeodo"), 0) > 0
):
In that case we would atleast not have it raise on comparing it. The data would still lack of course, so if the issue lies elsewhere and the api is supposed to ship that info to all vehicles then please ignore this comment.
I have the same error in HA with a Kia xCeed PHEV 2020
+1
pr for eu-api published ^
should be fine now @ridderr if you update to latest. please check and verify.