-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Add required_features
to Water
10000
Heater entity service registrations
#141873
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
Conversation
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
required_features
to water_heater service calls
All water heaters found via Not all have tests. After initial commit, running
Each water_heater.py was checked for these methods:
|
The econet integration includes the following: def supported_features(self) -> WaterHeaterEntityFeature:
"""Return the list of supported features."""
if self.water_heater.modes:
if self.water_heater.supports_away:
return SUPPORT_FLAGS_HEATER | WaterHeaterEntityFeature.AWAY_MODE
return SUPPORT_FLAGS_HEATER
if self.water_heater.supports_away:
return (
WaterHeaterEntityFeature.TARGET_TEMPERATURE
| WaterHeaterEntityFeature.AWAY_MODE
)
return WaterHeaterEntityFeature.TARGET_TEMPERATURE I am not 100% confident that this is OK, although @w1ll1am23, could you check it for me, please? |
required_features
to water_heater service callsrequired_features
to water_heater service call registrations
required_features
to water_heater service call registrationsrequired_features
to WaterHeater entity service registrations
@zxdavb I no longer have a water heater hooked up to econets API but this change seems like it would be okay to me. |
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.
Nice! Thanks, @zxdavb 👍
../Frenck
Proposed change
When WaterHeater entity services are registered by the platform, some do not specify the corresponding
required_features
(e.g.WaterHeaterEntityFeature.OPERATION_MODE
).This results in odd behaviour, such as #141868.
This PR addresses those omission (see initial commit).
This fix had the potential to be a breaking change, as integrations that support these services but that have not added the corresponding WaterHeaterEntityFeature to
_attr_supported_features
(or similar) will no longer expose that service.Thus, all water heaters were individually checked by hand.
These have needed a fix:
_attr_supported_features
(test now pass)ON_OFF
(and tests have been corrected as WaterHeater does not specifyrequired_features
for some entity services #141868 now fixed)ON_OFF
(has no test_water_heater.py)I am unable to add tests to the Hive integration, and so coverage is failing there.
These seem OK, and should work as before:
_attr_supported_features
, no test_water_heater.pyThese are/were OK:
_attr_supported_features
_attr_supported_features
Type of change
Additional information
required_features
for some entity services #141868Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: