-
Notifications
You must be signed in to change notification settings - Fork 232
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
Replaced deprecated constants and wildcard imports (HA >= 2023.1) #420
base: master
Are you sure you want to change the base?
Conversation
are you sure about 2023.1 ? |
Yes, I have tested, it works in 2023.1 All deprecation came before 2023.1, and the warning starts from 2024.1 |
Latest |
from homeassistant.components.climate import * | ||
from homeassistant.components.climate.const import * | ||
from homeassistant.components.climate import ClimateEntity | ||
from homeassistant.components.climate.const import ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import should be done always from root.
I suggest to run mypy/pylint o fix all those minor but important warnings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, fixed this.
Did a quick test and I this is the result:
Does latest code works fine for you ? |
Yes, works on my device without error. But I only have one What's your HA version? |
My devices are
2024.1.2 |
I found the issue and is not related to this PR as expected. Is related to the commit "restore status sensors of dhw & tbh". This changes are not in use currently as latest release is dated Oct 16th, while the changes were committed on Oct 17th. |
Thanks for testing. Does this mean that this PR is safe to merge? |
Yes this PR is safe to be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx @Necroneco, PR works fine
Any movement on this one? |
Hi, in v0.3.22 the implementation of the C3 heat pump is still buggy, see #353. The changes you had removed are currently only included in the master but are important for the C3 heat pump. Unfortunately, no new version has been released since then. You have to use the master as a starting point for the C3 heat pump implementation, not v0.3.22. |
Ok, rebased. but it doesn’t really matter, if this PR will be merged |
I still get the following warnings in the log for my C3 heat pump with the adjustments: `2024-03-17 13:10:32.143 WARNING (MainThread) [homeassistant.components.climate] Entity midea_ac_lan.142936511731561_climate_zone1 (<class 'custom_components.midea_ac_lan.climate.MideaC3Climate'>) does not set ClimateEntityFeature.TURN_OFF but implements the turn_off method. Please create a bug report at https://github.com/georgezhao2010/midea_ac_lan/issues 2024-03-17 13:10:32.143 WARNING (MainThread) [homeassistant.components.climate] Entity midea_ac_lan.142936511731561_climate_zone1 (<class 'custom_components.midea_ac_lan.climate.MideaC3Climate'>) does not set ClimateEntityFeature.TURN_ON but implements the turn_on method. Please create a bug report at https://github.com/georgezhao2010/midea_ac_lan/issues 2024-03-17 13:10:32.143 WARNING (MainThread) [homeassistant.components.climate] Entity midea_ac_lan.142936511731561_climate_zone1 (<class 'custom_components.midea_ac_lan.climate.MideaC3Climate'>) implements HVACMode(s): off, auto, cool, heat and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please create a bug report at https://github.com/georgezhao2010/midea_ac_lan/issues ` |
This is related to another issue, and I also fixed it here. |
Works perfectly. The error messages have disappeared. Thank you! |
# Conflicts: # custom_components/midea_ac_lan/climate.py
I've come across the same message... we all get it... |
Not sure if this should be fixed but with HA version 2024.5.0 I get a lot of these: Logger: homeassistant.components.climate SUPPORT_PRESET_MODE was used from midea_ac_lan, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.PRESET_MODE instead, please report it to the author of the 'midea_ac_lan' custom integration |
Hello, I think this has already been fixed by this PR |
Then it's not fixed... |
as current repo is not active more than 6 months. PR is welcome in addition, if you need PR merge permission, I will add more contributors later, it will not limit the repo admin permission in one person. Thanks |
Replaced deprecated constants, which fixed warning (or error in some cases) in HA 2024.1.0
And replaced wildcard imports, fixed warning in HA 2024.1.1
This will require HA 2023.1
see https://developers.home-assistant.io/blog/2023/12/19/constant-deprecation/
Fixed #415
Fixed #429
Fixed #433
Fixed #444
Fixed #455
Fixed #463
Fixed #476
Fixed #480
Fixed #510
Fixed a typo in
hacs.json
Also supported the new climate entity features flag, fixed warning in HA 2024.2
https://developers.home-assistant.io/blog/2024/01/24/climate-climateentityfeatures-expanded
Fixed #479
Merged PR #486 for convenience
Fix blocking call to import_module inside the event loop. (Warning in 2024.5)