Skip to content

Commit

Permalink
Update async_set_temperature to handle HVAC mode (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
mill1000 authored Jan 8, 2025
1 parent 0a6d18b commit 2cdd310
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/midea_ac/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

import voluptuous as vol
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (PRESET_AWAY, PRESET_BOOST,
from homeassistant.components.climate.const import (ATTR_HVAC_MODE,
PRESET_AWAY, PRESET_BOOST,
PRESET_ECO, PRESET_NONE,
PRESET_SLEEP,
ClimateEntityFeature,
Expand Down Expand Up @@ -286,6 +287,9 @@ async def async_set_temperature(self, **kwargs) -> None:
self._device.target_temperature = round(temperature * 2) / 2
await self._apply()

if (mode := kwargs.get(ATTR_HVAC_MODE, None)) is not None:
await self.async_set_hvac_mode(mode)

@property
def current_humidity(self) -> float | None:
"""Return the current humidity."""
Expand Down

0 comments on commit 2cdd310

Please sign in to comment.