Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions custom_components/wundasmart/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
HVACAction,
HVACMode,
PRESET_ECO,
PRESET_COMFORT
PRESET_COMFORT,
PRESET_NONE
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
Expand Down Expand Up @@ -43,6 +44,7 @@
PRESET_REDUCED = "reduced"

SUPPORTED_PRESET_MODES = [
PRESET_NONE,
PRESET_REDUCED,
PRESET_ECO,
PRESET_COMFORT
Expand Down Expand Up @@ -140,7 +142,7 @@ def __init__(
self._attr_target_temperature = None
self._attr_current_humidity = None
self._attr_hvac_mode = HVACMode.AUTO
self._attr_preset_mode = None
self._attr_preset_mode = PRESET_NONE
self._timeout = timeout

# Update with initial state
Expand Down Expand Up @@ -227,7 +229,7 @@ def __set_preset_mode(self):
except (ValueError, TypeError):
_LOGGER.warning(f"Unexpected {state_key} value '{state[state_key]}' for {self._attr_name}")
else:
self._attr_preset_mode = None
self._attr_preset_mode = PRESET_NONE

def __set_hvac_state(self):
"""Set the hvac action and hvac mode from the coordinator data."""
Expand Down Expand Up @@ -373,7 +375,7 @@ async def async_set_hvac_mode(self, hvac_mode: HVACMode):
await self.coordinator.async_request_refresh()

async def async_set_preset_mode(self, preset_mode) -> None:
if preset_mode:
if preset_mode and preset_mode != PRESET_NONE:
state_key = PRESET_MODE_STATE_KEYS.get(preset_mode)
if state_key is None:
raise NotImplementedError(f"Unsupported Preset mode {preset_mode}")
Expand Down
Loading