Skip to content

Commit

Permalink
Turn on HVAC before changing mode #366
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Oct 15, 2024
1 parent c868f29 commit 4c766bf
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions custom_components/yandex_station/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,16 @@ def on_track_humidity(self, value):

async def async_set_hvac_mode(self, hvac_mode: HVACMode):
if hvac_mode == HVACMode.OFF:
kwargs = {"on": False}
await self.quasar.device_action(self.device, "on", False)
elif self.hvac_instance is None:
kwargs = {"on": True}
await self.quasar.device_action(self.device, "on", True)
else:
kwargs = (
{"on": True, self.hvac_instance: str(hvac_mode)}
if self._attr_hvac_mode == HVACMode.OFF
else {self.hvac_instance: str(hvac_mode)}
if self._attr_hvac_mode == HVACMode.OFF:
await self.quasar.device_action(self.device, "on", True)
await self.quasar.device_action(
self.device, self.hvac_instance, str(hvac_mode)
)

await self.quasar.device_actions(self.device, **kwargs)

async def async_set_temperature(self, temperature: float, **kwargs):
await self.quasar.device_action(self.device, "temperature", temperature)

Expand Down

0 comments on commit 4c766bf

Please sign in to comment.