Adjust type hints for VacuumEntityFeature (#82269)

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

View file

@ -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

View file

@ -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

View file

@ -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",