mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Adjust type hints for UpdateEntityFeature (#82268)
This commit is contained in:
parent
295cd0143c
commit
3be750812d
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user