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

fix: change deprecated constants for HA 2024.1 #790

Closed hmmbob closed 6 months ago

hmmbob commented 6 months ago

Went through the codebase to fix the deprecated constant warning from HA 2024.1.0b2.

Had these in my log:

2023-12-31 13:12:33.939 WARNING (MainThread) [homeassistant.const] TIME_MINUTES was used from kia_uvo, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTime.MINUTES instead, please create a bug report at https://github.com/fuatakgun/kia_uvo/issues
2023-12-31 13:12:33.946 WARNING (MainThread) [homeassistant.const] TIME_DAYS was used from kia_uvo, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTime.DAYS instead, please create a bug report at https://github.com/fuatakgun/kia_uvo/issues
2023-12-31 13:12:33.953 WARNING (MainThread) [homeassistant.const] ENERGY_WATT_HOUR was used from kia_uvo, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfEnergy.WATT_HOUR instead, please create a bug report at https://github.com/fuatakgun/kia_uvo/issues
2023-12-31 13:12:33.960 WARNING (MainThread) [homeassistant.const] ENERGY_KILO_WATT_HOUR was used from kia_uvo, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfEnergy.KILO_WATT_HOUR instead, please create a bug report at https://github.com/fuatakgun/kia_uvo/issues
2023-12-31 13:12:33.969 WARNING (MainThread) [homeassistant.components.device_tracker] SOURCE_TYPE_GPS was used from kia_uvo, this is a deprecated constant which will be removed in HA Core 2025.1. Use SourceType.GPS instead, please create a bug report at https://github.com/fuatakgun/kia_uvo/issues
2023-12-31 13:12:33.976 WARNING (MainThread) [homeassistant.components.device_tracker] SOURCE_TYPE_GPS was used from kia_uvo, this is a deprecated constant which will be removed in HA Core 2025.1. Use SourceType.GPS instead, please create a bug report at https://github.com/fuatakgun/kia_uvo/issues

but found a few more - likely because the climate isn't supported on my vehicle.

tested locally, works fine. Climate wasn't tested yet (as my vehicle doesn't support that). Fixes #785

cdnninja commented 6 months ago

Awesome thank you for doing this!

cdnninja commented 6 months ago

Do you know by any chance the minimum version required for these new constants? If so we should update our minimum version as well. Each time these happen we get a few issues from people running old HA versions.

cdnninja commented 6 months ago

Found it 2023.1