-
-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
climate entity incorrectly reports integration as implicitly supporting turn_on/off without setting the proper ClimateEntityFeature #114286
Comments
Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) climate documentation |
Although I have found what is apparently the official way to work around the issue, the issue of the log messages being incorrect still exists in Home Assistant as a bug, and will be affecting other integrations as well. |
Can you make a pull request to fix? |
Current log message when climate.turn_on/off are implemented implicitly describes the wrong problem, and appears even when they are implemented explicitly. - tighten up the condition to only appear when a fallback to the default turn_on or turn_off methods will be used, as these are what will be removed at the end of the deprecation period. - change the message to make it clear that it is the default turn_on/off that is the problem, not just the support flags (if the functions are implemented without the support flags, there is another log message).
A message about implicit turn_on/off without feature flags was output even when the feature flags were set.
Setting |
That is the workaround that I installed in my integration, but it still does not fix the bug, which is that the wrong message is being logged under the wrong conditions. |
Yes, the error message seems to log incorrectly. Just wanted to mention that you should still set the value to |
After my proposed change, setting the "opt-out" variable is only necessary for integrations that do not want turn_on/off services implemented for some reason, even though they support HVAC_MODE_OFF and other modes. Integrations that already set the support flags should not be required to set extra opt-out variables to work around an incorrect log message (which is the only effect of setting that variable). Adding that requirement just creates additional busywork for custom integration authors who often have very little time to keep up with such changes. |
I am going to close this issue as it states explicitly in the blog post that integrations should set |
Disappointing that defending your past mistake is more important to this project than quality of the information you are logging. |
The problem
My integration explicitly supports turn_on and turn_off methods, and also sets the ClimateEntityFeature.TURN_ON and TURN_OFF flags in its supported_features. However users are constantly reporting that HA is outputting a log message saying
This is due to a missing condition on line 398 of climate/init.py, where it merely checks that the modes contain HVAC_OFF to output this message, without checking that the ClimateEntityFeature flag is set as the previous lines do, or whether the turn_off/turn_on methods are overridden by the integration, so the implicit fallback will actually be used.
What version of Home Assistant Core has the issue?
2024.3.3
What was the last working version of Home Assistant Core?
2024.1.6
What type of installation are you running?
Home Assistant OS
Integration causing the issue
climate
Link to integration documentation on our website
https://www.home-assistant.io/integrations/climate/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: