Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation of TEMP_CELCIUS in HA Core 2025.1 - Use UnitOfTemperature.CELSIUS instead #346

Closed
ruudw opened this issue Jul 23, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@ruudw
Copy link

ruudw commented Jul 23, 2024

The problem

Not really a bug, but rather a heads-up. As I plowed through my configuration I noticed this log:

Logger: homeassistant.const
Source: helpers/deprecation.py:197
First occurred: 22:01:48 (1 occurrences)
Last logged: 22:01:48

TEMP_CELSIUS was used from nest_protect, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.CELSIUS instead, please report it to the author of the 'nest_protect' custom integration

Therefore, I'll provide this kind reminder. :)

What version of this integration (ha-nest-protect) has the issue?

v0.4.0b4

What version of Home Assistant Core has the issue?

2025.1

Device / Model

No response

Diagnostics information

No response

Home Assistant log

Logs
Logger: homeassistant.const
Source: helpers/deprecation.py:197
First occurred: 22:01:48 (1 occurrences)
Last logged: 22:01:48

TEMP_CELSIUS was used from nest_protect, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.CELSIUS instead, please report it to the author of the 'nest_protect' custom integration

Additional information

No response

@ruudw ruudw added the bug Something isn't working label Jul 23, 2024
@iMicknl
Copy link
Owner

iMicknl commented Jul 28, 2024

Are you sure you use v0.4.0b4? This constant is not present in the beta branch anymore. :)

@ruudw
Copy link
Author

ruudw commented Jul 28, 2024

Yeah I might be in the wrong here. I took the version number from HACS directly but I just considered that might not be the installed version. :)

@AnthonyBe
Copy link

AnthonyBe commented Oct 5, 2024

I just updated from 0.3.12 where I was seeing this same warning, to 0.4.0b5 and I am no longer seeing this warning (TEMP_CELSIUS was used from nest_protect, this is a deprecated constant)

I'm also no longer seeing the other deprecation warning - StrEnum was used from nest_protect, this is a deprecated alias

Thanks @iMicknl !

@iMicknl
Copy link
Owner

iMicknl commented Oct 5, 2024

@AnthonyBe this warning indeed occurs on the current 'main' branch (0.3.12), this is fixed in the beta branch, but due to some issues and time constraints I haven't been able to move from beta to a new stable release.

@SeanPM5
Copy link

SeanPM5 commented Dec 24, 2024

Just updated to HA 2025.1 beta and Nest Protect integration fails to set up because of this. I see from this thread that it's fixed in the beta branch of this integration, but just wanted to give a heads up that it's about to break for everyone on the stable branch in a week from now.

Logger: homeassistant.config_entries
Source: config_entries.py:640

Error setting up entry Nest Protect for nest_protect
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/nest_protect/__init__.py", line 104, in async_setup_entry
    await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2278, in async_forward_entry_setups
    await integration.async_get_platforms(platforms)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1185, in async_get_platforms
    import_future.result()
    ~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1185, in async_get_platforms
    import_future.result()
    ~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1185, in async_get_platforms
    import_future.result()
    ~~~~~~~~~~~~~~~~~~~~^^
  [Previous line repeated 1 more time]
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1173, in async_get_platforms
    platforms.update(self._load_platforms(platform_names))
                     ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1098, in _load_platforms
    platform_name: self._load_platform(platform_name)
                   ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1272, in _load_platform
    cache[full_name] = self._import_platform(platform_name)
                       ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1304, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/nest_protect/sensor.py", line 14, in <module>
    from homeassistant.const import PERCENTAGE, TEMP_CELSIUS
ImportError: cannot import name 'TEMP_CELSIUS' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)

@iMicknl
Copy link
Owner

iMicknl commented Dec 27, 2024

Thanks for the heads-up, @SeanPM5! I will merge the current beta to main, or do a quick hotfix for this issue, prior to the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants