From d6100abc7cbeb72ad5e73429316cd3b872c85f46 Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Thu, 17 Feb 2022 21:06:35 +0100 Subject: [PATCH] Remove deprecated way of setting fan preset in Vallox (#66655) --- homeassistant/components/vallox/__init__.py | 33 ------------------- homeassistant/components/vallox/services.yaml | 16 --------- 2 files changed, 49 deletions(-) diff --git a/homeassistant/components/vallox/__init__.py b/homeassistant/components/vallox/__init__.py index 8a23f7d8df9..fcda7227945 100644 --- a/homeassistant/components/vallox/__init__.py +++ b/homeassistant/components/vallox/__init__.py @@ -29,7 +29,6 @@ from .const import ( METRIC_KEY_PROFILE_FAN_SPEED_BOOST, METRIC_KEY_PROFILE_FAN_SPEED_HOME, STATE_SCAN_INTERVAL, - STR_TO_VALLOX_PROFILE_SETTABLE, ) _LOGGER = logging.getLogger(__name__) @@ -55,17 +54,8 @@ PLATFORMS: list[str] = [ Platform.BINARY_SENSOR, ] -ATTR_PROFILE = "profile" ATTR_PROFILE_FAN_SPEED = "fan_speed" -SERVICE_SCHEMA_SET_PROFILE = vol.Schema( - { - vol.Required(ATTR_PROFILE): vol.All( - cv.string, vol.In(STR_TO_VALLOX_PROFILE_SETTABLE) - ) - } -) - SERVICE_SCHEMA_SET_PROFILE_FAN_SPEED = vol.Schema( { vol.Required(ATTR_PROFILE_FAN_SPEED): vol.All( @@ -82,16 +72,11 @@ class ServiceMethodDetails(NamedTuple): schema: vol.Schema -SERVICE_SET_PROFILE = "set_profile" SERVICE_SET_PROFILE_FAN_SPEED_HOME = "set_profile_fan_speed_home" SERVICE_SET_PROFILE_FAN_SPEED_AWAY = "set_profile_fan_speed_away" SERVICE_SET_PROFILE_FAN_SPEED_BOOST = "set_profile_fan_speed_boost" SERVICE_TO_METHOD = { - SERVICE_SET_PROFILE: ServiceMethodDetails( - method="async_set_profile", - schema=SERVICE_SCHEMA_SET_PROFILE, - ), SERVICE_SET_PROFILE_FAN_SPEED_HOME: ServiceMethodDetails( method="async_set_profile_fan_speed_home", schema=SERVICE_SCHEMA_SET_PROFILE_FAN_SPEED, @@ -229,24 +214,6 @@ class ValloxServiceHandler: self._client = client self._coordinator = coordinator - async def async_set_profile(self, profile: str = "Home") -> bool: - """Set the ventilation profile.""" - _LOGGER.debug("Setting ventilation profile to: %s", profile) - - _LOGGER.warning( - "Attention: The service 'vallox.set_profile' is superseded by the " - "'fan.set_preset_mode' service. It will be removed in the future, please migrate to " - "'fan.set_preset_mode' to prevent breakage" - ) - - try: - await self._client.set_profile(STR_TO_VALLOX_PROFILE_SETTABLE[profile]) - return True - - except (OSError, ValloxApiException) as err: - _LOGGER.error("Error setting ventilation profile: %s", err) - return False - async def async_set_profile_fan_speed_home( self, fan_speed: int = DEFAULT_FAN_SPEED_HOME ) -> bool: diff --git a/homeassistant/components/vallox/services.yaml b/homeassistant/components/vallox/services.yaml index 5cfa1dae4b5..d6a0ec238c3 100644 --- a/homeassistant/components/vallox/services.yaml +++ b/homeassistant/components/vallox/services.yaml @@ -1,19 +1,3 @@ -set_profile: - name: Set profile - description: Set the ventilation profile. - fields: - profile: - name: Profile - description: "Set profile." - required: true - selector: - select: - options: - - 'Away' - - 'Boost' - - 'Fireplace' - - 'Home' - set_profile_fan_speed_home: name: Set profile fan speed home description: Set the fan speed of the Home profile.