Skip to content
Snippets Groups Projects
Unverified Commit 2ac0aea7 authored by muchtall's avatar muchtall Committed by GitHub
Browse files

Fix Lyric cool mode (#54856)

* fixing Cool mode in lyric

* Use climate integration constants

I believe this fixes this issue: https://github.com/home-assistant/core/pull/51760#discussion_r650372737



* Run through black

* Delint

Co-authored-by: default avatarYadu Raghu <yraghu55@gmail.com>
Co-authored-by: default avatarMartin Hjelmare <marhje52@gmail.com>
parent e5f914bb
No related branches found
No related tags found
No related merge requests found
......@@ -190,6 +190,8 @@ class LyricClimate(LyricDeviceEntity, ClimateEntity):
"""Return the temperature we try to reach."""
device = self.device
if not device.hasDualSetpointStatus:
if self.hvac_mode == HVAC_MODE_COOL:
return device.changeableValues.coolSetpoint
return device.changeableValues.heatSetpoint
return None
......@@ -266,7 +268,14 @@ class LyricClimate(LyricDeviceEntity, ClimateEntity):
temp = kwargs.get(ATTR_TEMPERATURE)
_LOGGER.debug("Set temperature: %s", temp)
try:
await self._update_thermostat(self.location, device, heatSetpoint=temp)
if self.hvac_mode == HVAC_MODE_COOL:
await self._update_thermostat(
self.location, device, coolSetpoint=temp
)
else:
await self._update_thermostat(
self.location, device, heatSetpoint=temp
)
except LYRIC_EXCEPTIONS as exception:
_LOGGER.error(exception)
await self.coordinator.async_refresh()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment