caiosweet / Home-Assistant-custom-components-INGV

INGV - National Institute of Geophysics and Volcanology [Istituto Nazionale di Geofisica e Vulcanologia] Terremoti Italia.
http://www.ingv.it/it/
MIT License
23 stars 7 forks source link

deprecated constant which will be removed in HA Core 2025.1 #27

Closed heinemannj closed 9 months ago

heinemannj commented 11 months ago

LENGTH_MILES was used from ingv_centro_nazionale_terremoti, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfLength.MILES instead, please create a bug report at https://github.com/caiosweet/Home-Assistant-custom-components-INGV/issues

LENGTH_KILOMETERS was used from ingv_centro_nazionale_terremoti, this is a deprecated constant which will be removed in HA Core 2025.1.
Use UnitOfLength.KILOMETERS instead, please create a bug report at https://github.com/caiosweet/Home-Assistant-custom-components-INGV/issues
MarcoZ76 commented 10 months ago

I have this issue too

riddik14 commented 9 months ago

stesso problema, in realta sono 2

LENGTH_MILES was used from ingv_centro_nazionale_terremoti, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfLength.MILES instead, please create a bug report at https://github.com/caiosweet/Home-Assistant-custom-components-INGV/issues

LENGTH_KILOMETERS was used from ingv_centro_nazionale_terremoti, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfLength.KILOMETERS instead, please create a bug report at https://github.com/caiosweet/Home-Assistant-custom-components-INGV/issues

mrai64 commented 9 months ago

I'm py newbye but my suggest is that: init.py + geo_location.py

from homeassistant.const import ( CONF_LATITUDE, CONF_LONGITUDE, CONF_RADIUS,

 LENGTH_KILOMETERS,

# LENGTH_MILES,

)

add to remove LENGTH_KILOMETERS, LENGTH_MILES

from homeassistant.const import UnitOfLength

then substitute LENGHT_ with UnitOfLenght.MILES / KILOMETERS

caiosweet commented 9 months ago

I think that with the changes in @mrai64, the warning has been resolved.