Hyundai-Kia-Connect / kia_uvo

A Home Assistant HACS integration that supports Kia Connect(Uvo) and Hyundai Bluelink. The integration supports the EU, Canada and the USA.
MIT License
398 stars 84 forks source link

ERROR: '<' not supported between instances of 'float' and 'str' #748

Closed exactliez closed 8 months ago

exactliez commented 8 months ago

Region and Brand of car US Hyundai

Version of the integration 2.14.3

Describe the bug Receiving an error inside Home Assistant when attempting to update sensors" '<' not supported between instances of 'float' and 'str'

Debug logs if an error occurred

2023-11-13 11:03:21.122 ERROR (MainThread) [custom_components.kia_uvo.coordinator] Unexpected error fetching kia_uvo data: '<' not supported between instances of 'float' and 'str'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/kia_uvo/coordinator.py", line 142, in _async_update_data
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 79, in update_all_vehicles_with_cached_state
    self.update_vehicle_with_cached_state(vehicle_id)
  File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 84, in update_vehicle_with_cached_state
    self.api.update_vehicle_with_cached_state(self.token, vehicle)
  File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/HyundaiBlueLinkAPIUSA.py", line 427, in update_vehicle_with_cached_state
    if vehicle.odometer < get_child_value(
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'float' and 'str'

To Reproduce Run the "Hyundai / Kia Connect: Update" service from Home Assistant.

Expected behavior Sensors update as expected.

Additional context In its current state, the sensors are not accessible at all - they never refresh or load (even after rebooting the HA instance).

csmracing commented 8 months ago

Experiencing the same issue:

2023-11-13 05:51:23.318 ERROR (MainThread) [custom_components.kia_uvo.coordinator] Unexpected error fetching kia_uvo data: '<' not supported between instances of 'float' and 'str' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/kia_uvo/coordinator.py", line 142, in _async_update_data await self.hass.async_add_executor_job( File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 79, in update_all_vehicles_with_cached_state self.update_vehicle_with_cached_state(vehicle_id) File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 84, in update_vehicle_with_cached_state self.api.update_vehicle_with_cached_state(self.token, vehicle) File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/HyundaiBlueLinkAPIUSA.py", line 427, in update_vehicle_with_cached_state if vehicle.odometer < get_child_value( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: '<' not supported between instances of 'float' and 'str'

cdnninja commented 8 months ago

https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api/pull/443 may resolve this.

Please test by updating using hacs but select the version as "master" and restart HA.

csmracing commented 8 months ago

After setting the version to master, I am again getting data. Thank you for your quick response to this issue!

exactliez commented 8 months ago

@cdnninja – re-downloading the integration from HACS and choosing the 'master' version restored functionality for me as well, thank you! I try to keep this integration 'up-to-date' within Home Assistant, do you recommend sticking with the 'master' version and avoiding incremental updates?

Thanks for following up as well @csmracing !

cdnninja commented 8 months ago

@cdnninja – re-downloading the integration from HACS and choosing the 'master' version restored functionality for me as well, thank you! I try to keep this integration 'up-to-date' within Home Assistant, do you recommend sticking with the 'master' version and avoiding incremental updates?

Thanks for following up as well @csmracing !

Think of the master as a "beta" or current release. It has changes that were made right away.

The numbered releases take master and give it a version on Wednesdays and Sundays. It also occurs when we manually trigger it when getting a fix out asap.