|
12 | 12 | HVACAction, |
13 | 13 | HVACMode, |
14 | 14 | PRESET_ECO, |
15 | | - PRESET_COMFORT |
| 15 | + PRESET_COMFORT, |
| 16 | + PRESET_NONE |
16 | 17 | ) |
17 | 18 | from homeassistant.config_entries import ConfigEntry |
18 | 19 | from homeassistant.const import ( |
|
43 | 44 | PRESET_REDUCED = "reduced" |
44 | 45 |
|
45 | 46 | SUPPORTED_PRESET_MODES = [ |
| 47 | + PRESET_NONE, |
46 | 48 | PRESET_REDUCED, |
47 | 49 | PRESET_ECO, |
48 | 50 | PRESET_COMFORT |
@@ -140,7 +142,7 @@ def __init__( |
140 | 142 | self._attr_target_temperature = None |
141 | 143 | self._attr_current_humidity = None |
142 | 144 | self._attr_hvac_mode = HVACMode.AUTO |
143 | | - self._attr_preset_mode = None |
| 145 | + self._attr_preset_mode = PRESET_NONE |
144 | 146 | self._timeout = timeout |
145 | 147 |
|
146 | 148 | # Update with initial state |
@@ -227,7 +229,7 @@ def __set_preset_mode(self): |
227 | 229 | except (ValueError, TypeError): |
228 | 230 | _LOGGER.warning(f"Unexpected {state_key} value '{state[state_key]}' for {self._attr_name}") |
229 | 231 | else: |
230 | | - self._attr_preset_mode = None |
| 232 | + self._attr_preset_mode = PRESET_NONE |
231 | 233 |
|
232 | 234 | def __set_hvac_state(self): |
233 | 235 | """Set the hvac action and hvac mode from the coordinator data.""" |
@@ -373,7 +375,7 @@ async def async_set_hvac_mode(self, hvac_mode: HVACMode): |
373 | 375 | await self.coordinator.async_request_refresh() |
374 | 376 |
|
375 | 377 | async def async_set_preset_mode(self, preset_mode) -> None: |
376 | | - if preset_mode: |
| 378 | + if preset_mode and preset_mode != PRESET_NONE: |
377 | 379 | state_key = PRESET_MODE_STATE_KEYS.get(preset_mode) |
378 | 380 | if state_key is None: |
379 | 381 | raise NotImplementedError(f"Unsupported Preset mode {preset_mode}") |
|
0 commit comments