mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 07:37:34 +00:00
Return fan_speed_list based on SUPPORT_FAN_SPEED. (#35347)
This commit is contained in:
parent
53771bd576
commit
15e8f4614c
@ -249,7 +249,7 @@ class VacuumEntity(_BaseVacuum, ToggleEntity):
|
|||||||
@property
|
@property
|
||||||
def capability_attributes(self):
|
def capability_attributes(self):
|
||||||
"""Return capability attributes."""
|
"""Return capability attributes."""
|
||||||
if self.fan_speed is not None:
|
if self.supported_features & SUPPORT_FAN_SPEED:
|
||||||
return {ATTR_FAN_SPEED_LIST: self.fan_speed_list}
|
return {ATTR_FAN_SPEED_LIST: self.fan_speed_list}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -316,8 +316,7 @@ class VacuumDevice(VacuumEntity):
|
|||||||
"""Print deprecation warning."""
|
"""Print deprecation warning."""
|
||||||
super().__init_subclass__(**kwargs)
|
super().__init_subclass__(**kwargs)
|
||||||
_LOGGER.warning(
|
_LOGGER.warning(
|
||||||
"VacuumDevice is deprecated, modify %s to extend VacuumEntity",
|
"VacuumDevice is deprecated, modify %s to extend VacuumEntity", cls.__name__
|
||||||
cls.__name__,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -341,7 +340,7 @@ class StateVacuumEntity(_BaseVacuum):
|
|||||||
@property
|
@property
|
||||||
def capability_attributes(self):
|
def capability_attributes(self):
|
||||||
"""Return capability attributes."""
|
"""Return capability attributes."""
|
||||||
if self.fan_speed is not None:
|
if self.supported_features & SUPPORT_FAN_SPEED:
|
||||||
return {ATTR_FAN_SPEED_LIST: self.fan_speed_list}
|
return {ATTR_FAN_SPEED_LIST: self.fan_speed_list}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user