Limych / ha-snowtire

Home Assistant sensor to predict if it's time to change car tires from summer to winter and vice versa.
Other
27 stars 12 forks source link

Temperature utility deprecated since HA 2022.10, will stop working in 2023.4 #116

Closed tstabrawa closed 11 months ago

tstabrawa commented 1 year ago

Environment

Describe the bug

The following warning is logged by Home Assistant upon startup:

2023-02-12 23:50:03.979 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that uses temperature utility. This is deprecated since 2022.10 and will stop working in Home Assistant 2023.4, it should be updated to use unit_conversion.TemperatureConverter instead. Please report issue to the custom integration author for snowtire using this method at custom_components/snowtire/binary_sensor.py, line 147: temperature = convert_temperature(

Configuration.yaml


Add your configs here if any.

Steps to Reproduce

Restart Home Assistant. Observe warning in HA logs.

Expected behavior

Ideally, no warnings would be logged.

Debug log

2023-02-12 23:50:03.979 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that uses temperature utility. This is deprecated since 2022.10 and will stop working in Home Assistant 2023.4, it should be updated to use unit_conversion.TemperatureConverter instead. Please report issue to the custom integration author for snowtire using this method at custom_components/snowtire/binary_sensor.py, line 147: temperature = convert_temperature(

Additional context

N/A

tjorim commented 12 months ago

@Limych It stopped working for me in 2023.11.0b0:

Logger: homeassistant.config
Source: config.py:923
First occurred: 21:33:54 (1 occurrences)
Last logged: 21:33:54

Platform error: binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config.py", line 923, in async_process_component_config
    platform = p_integration.get_platform(domain)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 836, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 853, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/snowtire/binary_sensor.py", line 39, in <module>
    from homeassistant.util.temperature import convert as convert_temperature
ModuleNotFoundError: No module named 'homeassistant.util.temperature'
LukaszP2 commented 12 months ago

Same to me

fcastilloec commented 11 months ago

Now that 2023.11.0 has been released, this bug will hit everybody. I see there's a PR #119 that seems to fix this issue, any chance it could be reviewed and merged?

For anybody else that's affected by this issue, I just replaced the two lines of code inside custom_components/snowtire/binary_sensor.py as shown in the PR

groenmarsmannetje commented 11 months ago

And now it broke…. while there was so much time to prevent this from happening. Time to remove this integration because it is clear that it is no longer supported by the developer.

KrzysztofHajdamowicz commented 11 months ago

And now it broke…. while there was so much time to prevent this from happening. Time to remove this integration because it is clear that it is no longer supported by the developer.

I can fork this integration and accept incoming pull requests as a 'respirator'-level maintainer.