Skip to content
Merged

0.96.3 #25376

Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion homeassistant/components/climate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
})
SET_PRESET_MODE_SCHEMA = vol.Schema({
vol.Optional(ATTR_ENTITY_ID): cv.comp_entity_ids,
vol.Required(ATTR_PRESET_MODE): vol.Maybe(cv.string),
vol.Required(ATTR_PRESET_MODE): cv.string,
})
SET_HVAC_MODE_SCHEMA = vol.Schema({
vol.Optional(ATTR_ENTITY_ID): cv.comp_entity_ids,
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/climate/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
HVAC_MODE_FAN_ONLY,
]

# No preset is active
PRESET_NONE = 'none'

# Device is running an energy-saving mode
PRESET_ECO = 'eco'
Expand Down
11 changes: 11 additions & 0 deletions homeassistant/components/daikin/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,17 @@ async def async_update(self):
"""Retrieve latest state."""
await self._api.async_update()

async def async_turn_on(self):
"""Turn device on."""
await self._api.device.set({})

async def async_turn_off(self):
"""Turn device off."""
await self._api.device.set({
HA_ATTR_TO_DAIKIN[ATTR_HVAC_MODE]:
HA_STATE_TO_DAIKIN[HVAC_MODE_OFF]
})

@property
def device_info(self):
"""Return a device description for device registry."""
Expand Down
5 changes: 3 additions & 2 deletions homeassistant/components/ecobee/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
ATTR_TARGET_TEMP_LOW, ATTR_TARGET_TEMP_HIGH, SUPPORT_TARGET_TEMPERATURE,
SUPPORT_AUX_HEAT, SUPPORT_TARGET_TEMPERATURE_RANGE, SUPPORT_FAN_MODE,
PRESET_AWAY, FAN_AUTO, FAN_ON, CURRENT_HVAC_OFF, CURRENT_HVAC_HEAT,
CURRENT_HVAC_COOL, SUPPORT_PRESET_MODE
CURRENT_HVAC_COOL, SUPPORT_PRESET_MODE, PRESET_NONE
)
from homeassistant.const import (
ATTR_ENTITY_ID, STATE_ON, ATTR_TEMPERATURE, TEMP_FAHRENHEIT)
Expand Down Expand Up @@ -49,6 +49,7 @@
}

PRESET_MODES = [
PRESET_NONE,
PRESET_AWAY,
PRESET_HOME,
PRESET_SLEEP
Expand Down Expand Up @@ -331,7 +332,7 @@ def set_preset_mode(self, preset_mode):
self.thermostat_index, PRESET_TO_ECOBEE_HOLD[preset_mode],
self.hold_preference())

elif preset_mode is None:
elif preset_mode is PRESET_NONE:
self.data.ecobee.resume_program(self.thermostat_index)

else:
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/eq3btsmart/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
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
Expand Down Expand Up @@ -181,7 +181,7 @@ def preset_modes(self):

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]

Expand Down
32 changes: 13 additions & 19 deletions homeassistant/components/esphome/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ def hvac_modes(self) -> List[str]:
for mode in self._static_info.supported_modes
]

@property
def preset_modes(self):
"""Return preset modes."""
return [PRESET_AWAY] if self._static_info.supports_away else []

@property
def target_temperature_step(self) -> float:
"""Return the supported step of target temperature."""
Expand All @@ -97,7 +102,7 @@ def supported_features(self) -> int:
"""Return the list of supported features."""
features = 0
if self._static_info.supports_two_point_target_temperature:
features |= (SUPPORT_TARGET_TEMPERATURE_RANGE)
features |= SUPPORT_TARGET_TEMPERATURE_RANGE
else:
features |= SUPPORT_TARGET_TEMPERATURE
if self._static_info.supports_away:
Expand All @@ -109,6 +114,11 @@ def hvac_mode(self) -> Optional[str]:
"""Return current operation ie. heat, cool, idle."""
return _climate_modes.from_esphome(self._state.mode)

@esphome_state_property
def preset_mode(self):
"""Return current preset mode."""
return PRESET_AWAY if self._state.away else None

@esphome_state_property
def current_temperature(self) -> Optional[float]:
"""Return the current temperature."""
Expand Down Expand Up @@ -143,29 +153,13 @@ async def async_set_temperature(self, **kwargs) -> None:
data['target_temperature_high'] = kwargs[ATTR_TARGET_TEMP_HIGH]
await self._client.climate_command(**data)

async def async_set_operation_mode(self, operation_mode) -> None:
async def async_set_hvac_mode(self, hvac_mode: str) -> None:
"""Set new target operation mode."""
await self._client.climate_command(
key=self._static_info.key,
mode=_climate_modes.from_hass(operation_mode),
mode=_climate_modes.from_hass(hvac_mode),
)

@property
def preset_mode(self):
"""Return current preset mode."""
if self._state and self._state.away:
return PRESET_AWAY

return None

@property
def preset_modes(self):
"""Return preset modes."""
if self._static_info.supports_away:
return [PRESET_AWAY]

return []

async def async_set_preset_mode(self, preset_mode):
"""Set preset mode."""
away = preset_mode == PRESET_AWAY
Expand Down
7 changes: 3 additions & 4 deletions homeassistant/components/evohome/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from homeassistant.components.climate.const import (
HVAC_MODE_HEAT, HVAC_MODE_AUTO, HVAC_MODE_OFF,
CURRENT_HVAC_HEAT, CURRENT_HVAC_IDLE, CURRENT_HVAC_OFF,
PRESET_AWAY, PRESET_ECO, PRESET_HOME,
PRESET_AWAY, PRESET_ECO, PRESET_HOME, PRESET_NONE,
SUPPORT_TARGET_TEMPERATURE, SUPPORT_PRESET_MODE)
from homeassistant.const import PRECISION_TENTHS
from homeassistant.util.dt import parse_datetime
Expand Down Expand Up @@ -40,12 +40,11 @@
TCS_PRESET_TO_HA = {v: k for k, v in HA_PRESET_TO_TCS.items()}

EVO_PRESET_TO_HA = {
EVO_FOLLOW: None,
EVO_FOLLOW: PRESET_NONE,
EVO_TEMPOVER: 'temporary',
EVO_PERMOVER: 'permanent',
}
HA_PRESET_TO_EVO = {v: k for k, v in EVO_PRESET_TO_HA.items()
if v is not None}
HA_PRESET_TO_EVO = {v: k for k, v in EVO_PRESET_TO_HA.items()}


def setup_platform(hass, hass_config, add_entities,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/frontend/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Home Assistant Frontend",
"documentation": "https://www.home-assistant.io/components/frontend",
"requirements": [
"home-assistant-frontend==20190719.0"
"home-assistant-frontend==20190721.0"
],
"dependencies": [
"api",
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/generic_thermostat/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from homeassistant.components.climate.const import (
ATTR_PRESET_MODE, CURRENT_HVAC_COOL, CURRENT_HVAC_HEAT, CURRENT_HVAC_IDLE,
CURRENT_HVAC_OFF, HVAC_MODE_COOL, HVAC_MODE_HEAT, HVAC_MODE_OFF,
PRESET_AWAY, SUPPORT_PRESET_MODE, SUPPORT_TARGET_TEMPERATURE)
PRESET_AWAY, SUPPORT_PRESET_MODE, SUPPORT_TARGET_TEMPERATURE, PRESET_NONE)
from homeassistant.const import (
ATTR_ENTITY_ID, ATTR_TEMPERATURE, CONF_NAME, EVENT_HOMEASSISTANT_START,
PRECISION_HALVES, PRECISION_TENTHS, PRECISION_WHOLE, SERVICE_TURN_OFF,
Expand Down Expand Up @@ -251,7 +251,7 @@ def preset_mode(self):
def preset_modes(self):
"""Return a list of available preset modes."""
if self._away_temp:
return [PRESET_AWAY]
return [PRESET_NONE, PRESET_AWAY]
return None

async def async_set_hvac_mode(self, hvac_mode):
Expand Down Expand Up @@ -404,7 +404,7 @@ async def async_set_preset_mode(self, preset_mode: str):
self._saved_target_temp = self._target_temp
self._target_temp = self._away_temp
await self._async_control_heating(force=True)
elif not preset_mode and self._is_away:
elif preset_mode == PRESET_NONE and self._is_away:
self._is_away = False
self._target_temp = self._saved_target_temp
await self._async_control_heating(force=True)
Expand Down
7 changes: 7 additions & 0 deletions homeassistant/components/geniushub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ async def async_setup(hass, hass_config):
exc_info=True)
return False

_LOGGER.debug("zones_raw = %s", data._client.hub._zones_raw) # noqa; pylint: disable=protected-access
_LOGGER.debug("devices_raw = %s", data._client.hub._devices_raw) # noqa; pylint: disable=protected-access

async_track_time_interval(hass, data.async_update, SCAN_INTERVAL)

for platform in ['climate', 'water_heater']:
Expand Down Expand Up @@ -84,4 +87,8 @@ async def async_update(self, now, **kwargs):
except AssertionError: # assert response.status == HTTP_OK
_LOGGER.warning("Update failed.", exc_info=True)
return

_LOGGER.debug("zones_raw = %s", self._client.hub._zones_raw) # noqa; pylint: disable=protected-access
_LOGGER.debug("devices_raw = %s", self._client.hub._devices_raw) # noqa; pylint: disable=protected-access

async_dispatcher_send(self._hass, DOMAIN)
2 changes: 1 addition & 1 deletion homeassistant/components/geniushub/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Genius Hub",
"documentation": "https://www.home-assistant.io/components/geniushub",
"requirements": [
"geniushub-client==0.4.12"
"geniushub-client==0.4.15"
],
"dependencies": [],
"codeowners": ["@zxdavb"]
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/hive/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (
HVAC_MODE_AUTO, HVAC_MODE_HEAT, HVAC_MODE_OFF, PRESET_BOOST,
SUPPORT_PRESET_MODE, SUPPORT_TARGET_TEMPERATURE)
SUPPORT_PRESET_MODE, SUPPORT_TARGET_TEMPERATURE, PRESET_NONE)
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS

from . import DATA_HIVE, DOMAIN
Expand All @@ -21,7 +21,7 @@

SUPPORT_FLAGS = SUPPORT_TARGET_TEMPERATURE | SUPPORT_PRESET_MODE
SUPPORT_HVAC = [HVAC_MODE_AUTO, HVAC_MODE_HEAT, HVAC_MODE_OFF]
SUPPORT_PRESET = [PRESET_BOOST]
SUPPORT_PRESET = [PRESET_NONE, PRESET_BOOST]


def setup_platform(hass, config, add_entities, discovery_info=None):
Expand Down Expand Up @@ -168,7 +168,7 @@ def set_temperature(self, **kwargs):

def set_preset_mode(self, preset_mode) -> None:
"""Set new preset mode."""
if preset_mode is None and self.preset_mode == PRESET_BOOST:
if preset_mode == PRESET_NONE and self.preset_mode == PRESET_BOOST:
self.session.heating.turn_boost_off(self.node_id)

elif preset_mode == PRESET_BOOST:
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/homematicip_cloud/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (
HVAC_MODE_AUTO, HVAC_MODE_HEAT, PRESET_BOOST, PRESET_ECO,
SUPPORT_PRESET_MODE, SUPPORT_TARGET_TEMPERATURE)
SUPPORT_PRESET_MODE, SUPPORT_TARGET_TEMPERATURE, PRESET_NONE)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS
from homeassistant.core import HomeAssistant
Expand Down Expand Up @@ -121,7 +121,7 @@ def preset_modes(self):

Requires SUPPORT_PRESET_MODE.
"""
return [PRESET_BOOST]
return [PRESET_NONE, PRESET_BOOST]

@property
def min_temp(self) -> float:
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/honeywell/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
SUPPORT_TARGET_HUMIDITY, SUPPORT_TARGET_TEMPERATURE_RANGE,
CURRENT_HVAC_COOL, CURRENT_HVAC_HEAT, CURRENT_HVAC_IDLE, CURRENT_HVAC_OFF,
HVAC_MODE_OFF, HVAC_MODE_HEAT, HVAC_MODE_COOL, HVAC_MODE_HEAT_COOL,
PRESET_AWAY,
PRESET_AWAY, PRESET_NONE,
)
from homeassistant.const import (
CONF_PASSWORD, CONF_USERNAME, TEMP_CELSIUS, TEMP_FAHRENHEIT,
Expand Down Expand Up @@ -229,7 +229,7 @@ def preset_mode(self) -> Optional[str]:
@property
def preset_modes(self) -> Optional[List[str]]:
"""Return a list of available preset modes."""
return [PRESET_AWAY]
return [PRESET_NONE, PRESET_AWAY]

@property
def is_aux_heat(self) -> Optional[str]:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/knx/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def current_temperature(self):
@property
def target_temperature_step(self):
"""Return the supported step of target temperature."""
return self.device.temperature_step
return self.device.setpoint_shift_step

@property
def target_temperature(self):
Expand Down
5 changes: 4 additions & 1 deletion homeassistant/components/mqtt/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
HVAC_MODE_DRY, HVAC_MODE_FAN_ONLY, HVAC_MODE_HEAT, HVAC_MODE_OFF,
SUPPORT_AUX_HEAT, SUPPORT_FAN_MODE, SUPPORT_PRESET_MODE,
SUPPORT_SWING_MODE, SUPPORT_TARGET_TEMPERATURE, PRESET_AWAY,
SUPPORT_TARGET_TEMPERATURE_RANGE)
SUPPORT_TARGET_TEMPERATURE_RANGE, PRESET_NONE)
from homeassistant.components.fan import SPEED_HIGH, SPEED_LOW, SPEED_MEDIUM
from homeassistant.const import (
ATTR_TEMPERATURE, CONF_DEVICE, CONF_NAME, CONF_VALUE_TEMPLATE, STATE_ON)
Expand Down Expand Up @@ -538,6 +538,9 @@ def preset_modes(self):

presets.extend(self._config[CONF_HOLD_LIST])

if presets:
presets.insert(0, PRESET_NONE)

return presets

@property
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/nest/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ATTR_TARGET_TEMP_HIGH, ATTR_TARGET_TEMP_LOW, FAN_AUTO, FAN_ON,
HVAC_MODE_AUTO, HVAC_MODE_COOL, HVAC_MODE_HEAT, HVAC_MODE_OFF,
SUPPORT_PRESET_MODE, SUPPORT_FAN_MODE, SUPPORT_TARGET_TEMPERATURE,
SUPPORT_TARGET_TEMPERATURE_RANGE, PRESET_AWAY, PRESET_ECO)
SUPPORT_TARGET_TEMPERATURE_RANGE, PRESET_AWAY, PRESET_ECO, PRESET_NONE)
from homeassistant.const import (
ATTR_TEMPERATURE, CONF_SCAN_INTERVAL, TEMP_CELSIUS, TEMP_FAHRENHEIT)
from homeassistant.helpers.dispatcher import async_dispatcher_connect
Expand All @@ -28,7 +28,7 @@
NEST_MODE_COOL = 'cool'
NEST_MODE_OFF = 'off'

PRESET_MODES = [PRESET_AWAY, PRESET_ECO]
PRESET_MODES = [PRESET_NONE, PRESET_AWAY, PRESET_ECO]


def setup_platform(hass, config, add_entities, discovery_info=None):
Expand Down
Loading