mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Adjust type hints for VacuumEntityFeature (#82269)
This commit is contained in:
parent
3be750812d
commit
ced16da576
@ -83,7 +83,6 @@ class TuyaVacuumEntity(TuyaEntity, StateVacuumEntity):
|
|||||||
"""Init Tuya vacuum."""
|
"""Init Tuya vacuum."""
|
||||||
super().__init__(device, device_manager)
|
super().__init__(device, device_manager)
|
||||||
|
|
||||||
self._attr_supported_features = 0
|
|
||||||
self._attr_fan_speed_list = []
|
self._attr_fan_speed_list = []
|
||||||
|
|
||||||
self._attr_supported_features |= VacuumEntityFeature.SEND_COMMAND
|
self._attr_supported_features |= VacuumEntityFeature.SEND_COMMAND
|
||||||
|
@ -180,10 +180,10 @@ class _BaseVacuum(Entity):
|
|||||||
_attr_battery_level: int | None = None
|
_attr_battery_level: int | None = None
|
||||||
_attr_fan_speed: str | None = None
|
_attr_fan_speed: str | None = None
|
||||||
_attr_fan_speed_list: list[str]
|
_attr_fan_speed_list: list[str]
|
||||||
_attr_supported_features: int
|
_attr_supported_features: VacuumEntityFeature | int = 0
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_features(self) -> int:
|
def supported_features(self) -> VacuumEntityFeature | int:
|
||||||
"""Flag vacuum cleaner features that are supported."""
|
"""Flag vacuum cleaner features that are supported."""
|
||||||
return self._attr_supported_features
|
return self._attr_supported_features
|
||||||
|
|
||||||
|
@ -2394,6 +2394,10 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
|
|||||||
function_name="fan_speed_list",
|
function_name="fan_speed_list",
|
||||||
return_type="list[str]",
|
return_type="list[str]",
|
||||||
),
|
),
|
||||||
|
TypeHintMatch(
|
||||||
|
function_name="supported_features",
|
||||||
|
return_type=["VacuumEntityFeature", "int"],
|
||||||
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="stop",
|
function_name="stop",
|
||||||
kwargs_type="Any",
|
kwargs_type="Any",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user