From cba4bbe2faee9734f771662d385ebb3b8067bc76 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 21 Dec 2023 09:11:37 +0100 Subject: [PATCH 1/2] Support more swing modes * custom_components/daikin_residential_altherma/climate.py: --- .../daikin_residential_altherma/climate.py | 43 ++++++++++++------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/custom_components/daikin_residential_altherma/climate.py b/custom_components/daikin_residential_altherma/climate.py index 85b0108..8c7a7f6 100644 --- a/custom_components/daikin_residential_altherma/climate.py +++ b/custom_components/daikin_residential_altherma/climate.py @@ -477,13 +477,20 @@ def swing_mode(self): h = horizontal["currentMode"]["value"] if vertical is not None: v = vertical["currentMode"]["value"] - if h != "stop": + if h == "swing": swingMode = SWING_HORIZONTAL - if v != "stop": - if h != "stop": + if v == "swing": swingMode = SWING_BOTH else: swingMode = SWING_VERTICAL + if v == "floorHeatingAirflow": + swingMode = "floorHeatingAirflow" + if v == "windNice": + if h == "swing": + swingMode = "Comfort Airflow and Horizontal" + else: + swingMode = "Comfort Airflow" + return swingMode @property @@ -501,12 +508,18 @@ def swing_modes(self): for mode in horizontal["currentMode"]["values"]: if mode == "swing": swingModes.append(SWING_HORIZONTAL) + if mode == "floorHeatingAirflow": + swingModes.append(mode) if vertical is not None: for mode in vertical["currentMode"]["values"]: if mode == "swing": swingModes.append(SWING_VERTICAL) - if horizontal is not None: - swingModes.append(SWING_BOTH) + if horizontal is not None: + swingModes.append(SWING_BOTH) + if mode == "windNice": + swingModes.append("Comfort Airflow") + if horizontal is not None: + swingModes.append("Comfort Airflow and Horizontal") _LOGGER.info("Support swing modes %s", swingModes) return swingModes @@ -521,22 +534,22 @@ async def async_set_swing_mode(self, swing_mode): horizontal = fanDirection.get("horizontal") vertical = fanDirection.get("vertical") if horizontal is not None: - new_hMode = ( - "swing" - if swing_mode in (SWING_HORIZONTAL, SWING_BOTH) - else "stop" - ) + new_hMode = "stop" + if swing_mode in (SWING_HORIZONTAL, SWING_BOTH, "Comfort Airflow and Horizontal"): + new_hMode = "swing" res = await self._device.set_path(self._device.getId(), self.embedded_id, "fanControl", f"/operationModes/{operationmode}/fanDirection/horizontal/currentMode", new_hMode) if res is False: _LOGGER.warning("Device '%s' problem setting horizontal swing mode to %s", self._device.name, new_hMode) else: fanControl["value"]["operationModes"][operationmode]["fanDirection"]["horizontal"]["currentMode"]["value"] = new_hMode if vertical is not None: - new_vMode = ( - "swing" - if swing_mode in (SWING_VERTICAL, SWING_BOTH) - else "stop" - ) + new_vMode = "stop" + if swing_mode in (SWING_VERTICAL, SWING_BOTH): + new_vMode = "swing" + if swing_mode in ("floorHeatingAirflow"): + new_vMode = "floorHeatingAirflow" + if swing_mode in ("Comfort Airflow", "Comfort Airflow and Horizontal"): + new_vMode = "windNice" res &= await self._device.set_path(self._device.getId(), self.embedded_id, "fanControl", f"/operationModes/{operationmode}/fanDirection/vertical/currentMode", new_vMode) if res is False: _LOGGER.warning("Device '%s' problem setting horizontal swing mode to %s", self._device.name, new_vMode) From 2c408cd7a2aef5a83c72725d4428c935af47d1fb Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 21 Dec 2023 09:12:01 +0100 Subject: [PATCH 2/2] Increment version * custom_components/daikin_residential_altherma/manifest.json: --- custom_components/daikin_residential_altherma/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/daikin_residential_altherma/manifest.json b/custom_components/daikin_residential_altherma/manifest.json index c8c71ef..461fec0 100644 --- a/custom_components/daikin_residential_altherma/manifest.json +++ b/custom_components/daikin_residential_altherma/manifest.json @@ -12,5 +12,5 @@ "requirements": [ "oic==1.6.0" ], - "version": "3.0.1" + "version": "3.1.0" }