Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #107 from speleolontra/externalRoomTemperature
Browse files Browse the repository at this point in the history
Support controlMode externalRoomTemperature
  • Loading branch information
jwillemsen committed Mar 8, 2023
2 parents 65c022f + a242c77 commit 54daaee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions custom_components/daikin_residential_altherma/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -244,6 +250,8 @@ 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":
return float(self._device.getValue(ATTR_TARGET_LEAVINGWATER_OFFSET))
return None

@property
Expand All @@ -264,6 +272,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):
Expand Down
2 changes: 2 additions & 0 deletions custom_components/daikin_residential_altherma/daikin_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 54daaee

Please sign in to comment.