From 05192b7164cb1d5413cef55823329d5b392897d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=B8yer=20Iversen?= Date: Sat, 4 Apr 2020 14:07:36 +0200 Subject: [PATCH] Support melcloud swing mode (#33008) * melcloud, support for swing mode * Update homeassistant/components/melcloud/climate.py Co-Authored-By: Vilppu Vuorinen * Update homeassistant/components/melcloud/climate.py Co-Authored-By: Vilppu Vuorinen * Update homeassistant/components/melcloud/climate.py Co-Authored-By: Vilppu Vuorinen * Update homeassistant/components/melcloud/climate.py Co-Authored-By: Vilppu Vuorinen Co-authored-by: Vilppu Vuorinen --- homeassistant/components/melcloud/climate.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/melcloud/climate.py b/homeassistant/components/melcloud/climate.py index b7952077223..e2d1fdd984d 100644 --- a/homeassistant/components/melcloud/climate.py +++ b/homeassistant/components/melcloud/climate.py @@ -24,6 +24,7 @@ from homeassistant.components.climate.const import ( HVAC_MODE_HEAT_COOL, HVAC_MODE_OFF, SUPPORT_FAN_MODE, + SUPPORT_SWING_MODE, SUPPORT_TARGET_TEMPERATURE, ) from homeassistant.config_entries import ConfigEntry @@ -246,10 +247,24 @@ class AtaDeviceClimate(MelCloudClimate): ) await self._device.set({ata.PROPERTY_VANE_VERTICAL: position}) + @property + def swing_mode(self) -> Optional[str]: + """Return vertical vane position or mode.""" + return self._device.vane_vertical + + async def async_set_swing_mode(self, swing_mode) -> None: + """Set vertical vane position or mode.""" + await self.async_set_vane_vertical(swing_mode) + + @property + def swing_modes(self) -> Optional[str]: + """Return a list of available vertical vane positions and modes.""" + return self._device.vane_vertical_positions + @property def supported_features(self) -> int: """Return the list of supported features.""" - return SUPPORT_FAN_MODE | SUPPORT_TARGET_TEMPERATURE + return SUPPORT_FAN_MODE | SUPPORT_TARGET_TEMPERATURE | SUPPORT_SWING_MODE async def async_turn_on(self) -> None: """Turn the entity on."""