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
391 stars 81 forks source link

Not valid unit for device class distance #812

Closed jwillemsen closed 5 months ago

jwillemsen commented 5 months ago

Region and Brand of car

EU, Hyundai Kona 2024 (scc2 supported)

Version of the integration

master using hyundai_kia_connect_api==3.14.1

Describe the bug

I found the following errors in my HA log after upgrading to master so that I cloud test hyundai_kia_connect_api==3.14.1

Debug logs if an error occurred

Logger: homeassistant.components.sensor
Source: components/sensor/__init__.py:719
Integration: Sensor (documentation, issues)
First occurred: 1:38:12 PM (3 occurrences)
Last logged: 1:38:12 PM

Entity sensor.kona_total_driving_range (<class 'custom_components.kia_uvo.sensor.HyundaiKiaConnectSensor'>) is using native unit of measurement 'None' which is not a valid unit for the device class ('distance') it is using; expected one of ['km', 'cm', 'ft', 'mi', 'yd', 'm', 'mm', 'in']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/fuatakgun/kia_uvo/issues
Entity sensor.kona_target_range_of_charge_ac (<class 'custom_components.kia_uvo.sensor.HyundaiKiaConnectSensor'>) is using native unit of measurement 'None' which is not a valid unit for the device class ('distance') it is using; expected one of ['km', 'cm', 'ft', 'mi', 'yd', 'm', 'mm', 'in']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/fuatakgun/kia_uvo/issues
Entity sensor.kona_target_range_of_charge_dc (<class 'custom_components.kia_uvo.sensor.HyundaiKiaConnectSensor'>) is using native unit of measurement 'None' which is not a valid unit for the device class ('distance') it is using; expected one of ['km', 'cm', 'ft', 'mi', 'yd', 'm', 'mm', 'in']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/fuatakgun/kia_uvo/issues
Bubo08 commented 5 months ago

I see the same. Not sure were it is comming from. The hard coded odometer (km) is working.

Bubo08 commented 5 months ago

I think I found the problem. It should be fixed now. https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api/pull/491

Bad pull request. I will check it in tomorrow again.

Bubo08 commented 5 months ago

Pull request created: https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api/pull/492 You may test it.

Bubo08 commented 5 months ago

A new version 2.20 is out which has fixed this bug. You might control and close this bug.

jwillemsen commented 5 months ago

The changes where merged after 2.20, so we need a new 2.21 for this

Bubo08 commented 5 months ago

It was included in v3.14.2 and that is included in the manifest. I also checked my log and I did not see the error messages anymore. So It looks good :-)

cdnninja commented 5 months ago

You can try it out by using HACS and using redownload and select master version. Releases of Ki_uvo auto release Sundays and Wednesday. Or if we force it.

jwillemsen commented 5 months ago

Fixed, warnings gone