Skip to content

Commit

Permalink
fixing correct SET TEMP in cool mode and also ability to set temperat…
Browse files Browse the repository at this point in the history
…ure in Cool mode
  • Loading branch information
yraghu committed Jun 4, 2021
1 parent bbc565b commit ed30de0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions custom_components/lyric/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ def target_temperature(self) -> float | None:
"""Return the temperature we try to reach."""
device = self.device
if not device.hasDualSetpointStatus:
return device.changeableValues.heatSetpoint
if LYRIC_HVAC_MODE_COOL.lower() in self.hvac_mode:
return device.changeableValues.coolSetpoint
else:
return device.changeableValues.heatSetpoint
return None

@property
Expand Down Expand Up @@ -266,7 +269,11 @@ async def async_set_temperature(self, **kwargs) -> None:
temp = kwargs.get(ATTR_TEMPERATURE)
_LOGGER.debug("Set temperature: %s", temp)
try:
await self._update_thermostat(self.location, device, heatSetpoint=temp)
if LYRIC_HVAC_MODE_COOL.lower() in self.hvac_mode:
# Setting both cool and heat due to bug in aiolyric
await self._update_thermostat(self.location, device, coolSetpoint=temp, heatSetpoint=temp)
else:
await self._update_thermostat(self.location, device, heatSetpoint=temp)
except LYRIC_EXCEPTIONS as exception:
_LOGGER.error(exception)
await self.coordinator.async_refresh()
Expand Down

0 comments on commit ed30de0

Please sign in to comment.