Update mqtt vacuum supported features (#95830)

* Update mqtt vacuum supported features

* Update test
This commit is contained in:
Erik Montnemery 2023-07-04 14:18:42 +02:00 committed by GitHub
parent c26dc0940c
commit 2ca648584d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

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

View File

@ -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"]
)