Introduce PRESET_NONE for climate (#25360)
* Introduce PRESET_NONE for climate * Require preset mode to be a string * Lint * Fix tests
This commit is contained in:
parent
17d754dbbf
commit
50d4921d0a
18 changed files with 44 additions and 38 deletions
|
@ -7,7 +7,7 @@ import voluptuous as vol
|
|||
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_AUTO, HVAC_MODE_HEAT, HVAC_MODE_OFF, PRESET_AWAY, PRESET_BOOST,
|
||||
SUPPORT_PRESET_MODE, SUPPORT_TARGET_TEMPERATURE)
|
||||
SUPPORT_PRESET_MODE, SUPPORT_TARGET_TEMPERATURE, PRESET_NONE)
|
||||
from homeassistant.const import (
|
||||
ATTR_TEMPERATURE, CONF_DEVICES, CONF_MAC, PRECISION_HALVES, TEMP_CELSIUS)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
@ -181,7 +181,7 @@ class EQ3BTSmartThermostat(ClimateDevice):
|
|||
|
||||
def set_preset_mode(self, preset_mode):
|
||||
"""Set new preset mode."""
|
||||
if not preset_mode:
|
||||
if preset_mode == PRESET_NONE:
|
||||
self.set_hvac_mode(HVAC_MODE_HEAT)
|
||||
self._thermostat.mode = HA_TO_EQ_PRESET[preset_mode]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue