mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Update mqtt vacuum supported features (#95830)
* Update mqtt vacuum supported features * Update test
This commit is contained in:
parent
c26dc0940c
commit
2ca648584d
@ -64,7 +64,6 @@ DEFAULT_SERVICES = (
|
||||
VacuumEntityFeature.START
|
||||
| VacuumEntityFeature.STOP
|
||||
| VacuumEntityFeature.RETURN_HOME
|
||||
| VacuumEntityFeature.STATUS
|
||||
| VacuumEntityFeature.BATTERY
|
||||
| VacuumEntityFeature.CLEAN_SPOT
|
||||
)
|
||||
@ -199,7 +198,7 @@ class MqttStateVacuum(MqttEntity, StateVacuumEntity):
|
||||
def _setup_from_config(self, config: ConfigType) -> None:
|
||||
"""(Re)Setup the entity."""
|
||||
supported_feature_strings: list[str] = config[CONF_SUPPORTED_FEATURES]
|
||||
self._attr_supported_features = strings_to_services(
|
||||
self._attr_supported_features = VacuumEntityFeature.STATE | strings_to_services(
|
||||
supported_feature_strings, STRING_TO_SERVICE
|
||||
)
|
||||
self._attr_fan_speed_list = config[CONF_FAN_SPEED_LIST]
|
||||
|
@ -112,7 +112,7 @@ async def test_default_supported_features(
|
||||
entity = hass.states.get("vacuum.mqtttest")
|
||||
entity_features = entity.attributes.get(mqttvacuum.CONF_SUPPORTED_FEATURES, 0)
|
||||
assert sorted(services_to_strings(entity_features, SERVICE_TO_STRING)) == sorted(
|
||||
["start", "stop", "return_home", "battery", "status", "clean_spot"]
|
||||
["start", "stop", "return_home", "battery", "clean_spot"]
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user