Adjust type hints for VacuumEntityFeature (#82269)
This commit is contained in:
parent
3be750812d
commit
ced16da576
3 changed files with 6 additions and 3 deletions
|
@ -83,7 +83,6 @@ class TuyaVacuumEntity(TuyaEntity, StateVacuumEntity):
|
|||
"""Init Tuya vacuum."""
|
||||
super().__init__(device, device_manager)
|
||||
|
||||
self._attr_supported_features = 0
|
||||
self._attr_fan_speed_list = []
|
||||
|
||||
self._attr_supported_features |= VacuumEntityFeature.SEND_COMMAND
|
||||
|
|
|
@ -180,10 +180,10 @@ class _BaseVacuum(Entity):
|
|||
_attr_battery_level: int | None = None
|
||||
_attr_fan_speed: str | None = None
|
||||
_attr_fan_speed_list: list[str]
|
||||
_attr_supported_features: int
|
||||
_attr_supported_features: VacuumEntityFeature | int = 0
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
def supported_features(self) -> VacuumEntityFeature | int:
|
||||
"""Flag vacuum cleaner features that are supported."""
|
||||
return self._attr_supported_features
|
||||
|
||||
|
|
|
@ -2394,6 +2394,10 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
|
|||
function_name="fan_speed_list",
|
||||
return_type="list[str]",
|
||||
),
|
||||
TypeHintMatch(
|
||||
function_name="supported_features",
|
||||
return_type=["VacuumEntityFeature", "int"],
|
||||
),
|
||||
TypeHintMatch(
|
||||
function_name="stop",
|
||||
kwargs_type="Any",
|
||||
|
|
Loading…
Add table
Reference in a new issue