ha-warmup/warmup

Use of Depreciated Constants

Closed this issue · 10 comments

After upgrading to Home Assistant 2024.0 I am receiving the following warning in my files.

Hopefully this can be fixed

thanks for this great plugin

Logger: homeassistant.components.climate.const
Source: helpers/deprecation.py:205
Integration: Climate (documentation, issues)
First occurred: 19:46:32 (8 occurrences)
Last logged: 19:46:32

HVAC_MODE_AUTO was used from warmup, this is a deprecated constant which will be removed in HA Core 2025.1. Use HVACMode.AUTO instead, please create a bug report at https://github.com/ha-warmup/warmup/issues/
HVAC_MODE_HEAT was used from warmup, this is a deprecated constant which will be removed in HA Core 2025.1. Use HVACMode.HEAT instead, please create a bug report at https://github.com/ha-warmup/warmup/issues/
HVAC_MODE_OFF was used from warmup, this is a deprecated constant which will be removed in HA Core 2025.1. Use HVACMode.OFF instead, please create a bug report at https://github.com/ha-warmup/warmup/issues/
SUPPORT_PRESET_MODE was used from warmup, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.PRESET_MODE instead, please create a bug report at https://github.com/ha-warmup/warmup/issues/
SUPPORT_TARGET_TEMPERATURE was used from warmup, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.TARGET_TEMPERATURE instead, please create a bug report at https://github.com/ha-warmup/warmup/issues/

Thank you very much for notifying us of this deprecation warning, @oceanice

Fortunately the HA Core team is giving us sufficient time to get this resolved before it risks failure. The code change looks like it should be relatively simple to switch over, but it will be handy if people are available to test once the changes are developed.

I, or one of the other devs, will announce when a PR is ready with a new branch of this plugin. Then hopefully we can get instructions issued for those who install manually AND those who install via HACS, to get thorough testing before a formal release.

In the meantime, I hope that you continue to enjoy your warmth-coming-up in that time of year when it's needed the most :)

I started working on it, but it looks like @artmg already made a different branch. I didn't branch off dev as it looked out of date.

I've tested a fixed version of climate.py, off master. @artmg I can do a PR if you like, or if you prefer I can re-do on the new branch.

Thanks for getting onto that so quickly, @robchandhok - your fix-2024-constants branch looks fine to PR upstream. And yes, I need to clean up dev up here.

Would you mind just doing the compare to the new branch to raise the PR, so that people can elect to test it before we bring it into the master and publish it towards HACS.

I appreciate your prompt code contribution!

Thanks to Rob, the modified code is now available for testing, first via the branch depr_25.1_hvac. Anyone who wishes to test may use the alternative manual install method specifying this branch, e.g.

git clone -b depr_25.1_hvac https://github.com/ha-warmup/warmup.git /tmp/warmup

Once we have an independent thumbs up or two I will bundle this up as a beta release for HACS users to test.

I was able to install the depr_25.1_hvac branch on HASOS / HACS by calling the update.install service

service: update.install
data:
  version: depr_25.1_hvac
target:
  entity_id: update.warmup_under_floor_heating_integration_update

Warmup 6iE, single zone electric underfloor heating. All looks OK so far and I can confirm the deprecation warnings are gone.

Thanks for that additional confirmation @peternash – I will now put together a pre-release for HACS for wider testing. Thanks also for clarifying the update.install service method, which I have added to the CONTRIBUTING.md instructions.
I appreciate your contributions :)

This has now been set as Prerelease v2024.2.7 so should be available to all HACS users who have set show beta versions on their HACS Warmup component.

Please report any remaining issues else I will close this issue soon.

Thanks to all who helped identify, develop and test this issue!

@artmg I think this should get pushed to a real (non-beta) release and closed. thanks!

Release unmarked as Prerelease and Marked as Latest. Thanks for you commits and support @robchandhok and for your reporting @oceanice and @peternash