Enforce WaterHeaterEntityFeature (#82467)

This commit is contained in:
epenet 2022-11-22 07:27:09 +01:00 committed by GitHub
parent ab26ea06b9
commit 4134d722da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -167,7 +167,7 @@ class WaterHeaterEntity(Entity):
_attr_operation_list: list[str] | None = None
_attr_precision: float
_attr_state: None = None
_attr_supported_features: WaterHeaterEntityFeature | int = 0
_attr_supported_features: WaterHeaterEntityFeature = WaterHeaterEntityFeature(0)
_attr_target_temperature_high: float | None = None
_attr_target_temperature_low: float | None = None
_attr_target_temperature: float | None = None
@ -338,7 +338,7 @@ class WaterHeaterEntity(Entity):
)
@property
def supported_features(self) -> WaterHeaterEntityFeature | int:
def supported_features(self) -> WaterHeaterEntityFeature:
"""Return the list of supported features."""
return self._attr_supported_features

View File

@ -2539,7 +2539,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
),
TypeHintMatch(
function_name="supported_features",
return_type=["WaterHeaterEntityFeature", "int"],
return_type="WaterHeaterEntityFeature",
),
TypeHintMatch(
function_name="target_temperature",