mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Enforce UpdateEntityFeature (#82465)
This commit is contained in:
parent
ff5f1aee53
commit
ab26ea06b9
@ -253,9 +253,9 @@ class MqttUpdate(MqttEntity, UpdateEntity, RestoreEntity):
|
||||
get_mqtt_data(self.hass).state_write_requests.write_state_request(self)
|
||||
|
||||
@property
|
||||
def supported_features(self) -> UpdateEntityFeature | int:
|
||||
def supported_features(self) -> UpdateEntityFeature:
|
||||
"""Return the list of supported features."""
|
||||
support = 0
|
||||
support = UpdateEntityFeature(0)
|
||||
|
||||
if self._config.get(CONF_COMMAND_TOPIC) is not None:
|
||||
support |= UpdateEntityFeature.INSTALL
|
||||
|
@ -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: UpdateEntityFeature | int = 0
|
||||
_attr_supported_features: UpdateEntityFeature = UpdateEntityFeature(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) -> UpdateEntityFeature | int:
|
||||
def supported_features(self) -> UpdateEntityFeature:
|
||||
"""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=["UpdateEntityFeature", "int"],
|
||||
return_type="UpdateEntityFeature",
|
||||
),
|
||||
TypeHintMatch(
|
||||
function_name="title",
|
||||
|
Loading…
x
Reference in New Issue
Block a user