From bef81ebab24ea2ac2fa21dcee55d8577e313d29d Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Wed, 8 Mar 2023 07:56:30 +0100 Subject: [PATCH 1/3] Support controlMode externalRoomTemperature * custom_components/daikin_residential_altherma/climate.py: --- .../daikin_residential_altherma/climate.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/custom_components/daikin_residential_altherma/climate.py b/custom_components/daikin_residential_altherma/climate.py index fbff4bff..e1a77b54 100644 --- a/custom_components/daikin_residential_altherma/climate.py +++ b/custom_components/daikin_residential_altherma/climate.py @@ -186,6 +186,8 @@ def current_temperature(self): return self._device.getValue(ATTR_ROOM_TEMPERATURE) if controlMode == "leavingWaterTemperature": return self._device.getValue(ATTR_LEAVINGWATER_TEMPERATURE) + if controlMode == "externalRoomTemperature": + return self._device.getValue(ATTR_LEAVINGWATER_TEMPERATURE) return None @property @@ -206,6 +208,8 @@ def max_temp(self): return float(self._device.getData(ATTR_TARGET_LEAVINGWATER_OFFSET)["maxValue"]) if self._device.getData(ATTR_TARGET_LEAVINGWATER_TEMPERATURE) is not None: return float(self._device.getData(ATTR_TARGET_LEAVINGWATER_TEMPERATURE)["maxValue"]) + if controlMode == "externalRoomTemperature": + return float(self._device.getData(ATTR_TARGET_LEAVINGWATER_OFFSET)["maxValue"]) return DEFAULT_MAX_TEMP @property @@ -226,6 +230,8 @@ def min_temp(self): return float(self._device.getData(ATTR_TARGET_LEAVINGWATER_OFFSET)["minValue"]) if self._device.getData(ATTR_TARGET_LEAVINGWATER_TEMPERATURE) is not None: return float(self._device.getData(ATTR_TARGET_LEAVINGWATER_TEMPERATURE)["minValue"]) + if controlMode == "externalRoomTemperature": + return float(self._device.getData(ATTR_TARGET_LEAVINGWATER_OFFSET)["minValue"]) return DEFAULT_MIN_TEMP @property @@ -244,6 +250,9 @@ def target_temperature(self): return float(self._device.getValue(ATTR_TARGET_LEAVINGWATER_OFFSET)) if self._device.getData(ATTR_TARGET_LEAVINGWATER_TEMPERATURE) is not None: return float(self._device.getValue(ATTR_TARGET_LEAVINGWATER_TEMPERATURE)) + if controlMode == "externalRoomTemperature": + if self._device.getData(ATTR_TARGET_LEAVINGWATER_OFFSET) is not None: + return float(self._device.getValue(ATTR_TARGET_LEAVINGWATER_OFFSET)) return None @property @@ -264,6 +273,8 @@ def target_temperature_step(self): return float(self._device.getData(ATTR_TARGET_LEAVINGWATER_OFFSET)["stepValue"]) if self._device.getData(ATTR_TARGET_LEAVINGWATER_TEMPERATURE) is not None: return float(self._device.getData(ATTR_TARGET_LEAVINGWATER_TEMPERATURE)["stepValue"]) + if controlMode == "externalRoomTemperature": + return float(self._device.getData(ATTR_TARGET_LEAVINGWATER_OFFSET)["stepValue"]) return None async def async_set_temperature(self, **kwargs): From c86ac91d70f7bc1e153cd9448ff0d12d09e10165 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Wed, 8 Mar 2023 07:57:38 +0100 Subject: [PATCH 2/3] Removed unncessary check * custom_components/daikin_residential_altherma/climate.py: --- custom_components/daikin_residential_altherma/climate.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/custom_components/daikin_residential_altherma/climate.py b/custom_components/daikin_residential_altherma/climate.py index e1a77b54..b4816809 100644 --- a/custom_components/daikin_residential_altherma/climate.py +++ b/custom_components/daikin_residential_altherma/climate.py @@ -251,8 +251,7 @@ def target_temperature(self): if self._device.getData(ATTR_TARGET_LEAVINGWATER_TEMPERATURE) is not None: return float(self._device.getValue(ATTR_TARGET_LEAVINGWATER_TEMPERATURE)) if controlMode == "externalRoomTemperature": - if self._device.getData(ATTR_TARGET_LEAVINGWATER_OFFSET) is not None: - return float(self._device.getValue(ATTR_TARGET_LEAVINGWATER_OFFSET)) + return float(self._device.getValue(ATTR_TARGET_LEAVINGWATER_OFFSET)) return None @property From 207b7f2ea8f2c31cfd7f3f16ebb8075e8c0df80f Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Wed, 8 Mar 2023 11:39:28 +0100 Subject: [PATCH 3/3] Another change for externalRoomTemperature * custom_components/daikin_residential_altherma/daikin_base.py: --- custom_components/daikin_residential_altherma/daikin_base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/daikin_residential_altherma/daikin_base.py b/custom_components/daikin_residential_altherma/daikin_base.py index fb194104..1fecc6f0 100644 --- a/custom_components/daikin_residential_altherma/daikin_base.py +++ b/custom_components/daikin_residential_altherma/daikin_base.py @@ -212,6 +212,8 @@ async def async_set_temperature(self, value): return await self.setValue(ATTR_TARGET_LEAVINGWATER_OFFSET, int(value)) if self.getData(ATTR_TARGET_LEAVINGWATER_TEMPERATURE) is not None: return await self.setValue(ATTR_TARGET_LEAVINGWATER_TEMPERATURE, int(value)) + if controlMode == "externalRoomTemperature": + return await self.setValue(ATTR_TARGET_LEAVINGWATER_OFFSET, int(value)) return None