Adjust type hints for UpdateEntityFeature (#82268)

This commit is contained in:
epenet 2022-11-17 15:17:50 +01:00 committed by GitHub
parent 295cd0143c
commit 3be750812d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -253,7 +253,7 @@ class MqttUpdate(MqttEntity, UpdateEntity, RestoreEntity):
get_mqtt_data(self.hass).state_write_requests.write_state_request(self)
@property
def supported_features(self) -> int:
def supported_features(self) -> UpdateEntityFeature | int:
"""Return the list of supported features."""
support = 0

View File

@ -190,7 +190,7 @@ class UpdateEntity(RestoreEntity):
_attr_release_summary: str | None = None
_attr_release_url: str | None = None
_attr_state: None = None
_attr_supported_features: int = 0
_attr_supported_features: UpdateEntityFeature | int = 0
_attr_title: str | None = None
__skipped_version: str | None = None
__in_progress: bool = False
@ -270,7 +270,7 @@ class UpdateEntity(RestoreEntity):
return self._attr_release_url
@property
def supported_features(self) -> int:
def supported_features(self) -> UpdateEntityFeature | int:
"""Flag supported features."""
return self._attr_supported_features

View File

@ -2345,7 +2345,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
),
TypeHintMatch(
function_name="supported_features",
return_type="int",
return_type=["UpdateEntityFeature", "int"],
),
TypeHintMatch(
function_name="title",