Cleanup climate and ecobee (#5616)

* Remove redundant input validation which is already accomplished through
defined schemata.

* Rely on defined state attributes for hold mode.

* Remove misleading comment. This comment seems to assume that sleep
mode is a hold; it is a schedule instead. The code snippets in the
comment could never work.

* Remove use of constants for hold mode. Will be made irrelevant
by a planned change by nordlead2005.
This commit is contained in:
Duoxilian 2017-02-02 08:28:32 -06:00 committed by Martin Hjelmare
parent ff65c2a114
commit 219337a574
2 changed files with 0 additions and 46 deletions

View file

@ -243,12 +243,6 @@ def async_setup(hass, config):
away_mode = service.data.get(ATTR_AWAY_MODE)
if away_mode is None:
_LOGGER.error(
"Received call to %s without attribute %s",
SERVICE_SET_AWAY_MODE, ATTR_AWAY_MODE)
return
_LOGGER.warning(
'This service has been deprecated; use climate.set_hold_mode')
for climate in target_climate:
@ -288,12 +282,6 @@ def async_setup(hass, config):
aux_heat = service.data.get(ATTR_AUX_HEAT)
if aux_heat is None:
_LOGGER.error(
"Received call to %s without attribute %s",
SERVICE_SET_AUX_HEAT, ATTR_AUX_HEAT)
return
for climate in target_climate:
if aux_heat:
yield from climate.async_turn_aux_heat_on()
@ -340,12 +328,6 @@ def async_setup(hass, config):
humidity = service.data.get(ATTR_HUMIDITY)
if humidity is None:
_LOGGER.error(
"Received call to %s without attribute %s",
SERVICE_SET_HUMIDITY, ATTR_HUMIDITY)
return
for climate in target_climate:
yield from climate.async_set_humidity(humidity)
@ -363,12 +345,6 @@ def async_setup(hass, config):
fan = service.data.get(ATTR_FAN_MODE)
if fan is None:
_LOGGER.error(
"Received call to %s without attribute %s",
SERVICE_SET_FAN_MODE, ATTR_FAN_MODE)
return
for climate in target_climate:
yield from climate.async_set_fan_mode(fan)
@ -386,12 +362,6 @@ def async_setup(hass, config):
operation_mode = service.data.get(ATTR_OPERATION_MODE)
if operation_mode is None:
_LOGGER.error(
"Received call to %s without attribute %s",
SERVICE_SET_OPERATION_MODE, ATTR_OPERATION_MODE)
return
for climate in target_climate:
yield from climate.async_set_operation_mode(operation_mode)
@ -409,12 +379,6 @@ def async_setup(hass, config):
swing_mode = service.data.get(ATTR_SWING_MODE)
if swing_mode is None:
_LOGGER.error(
"Received call to %s without attribute %s",
SERVICE_SET_SWING_MODE, ATTR_SWING_MODE)
return
for climate in target_climate:
yield from climate.async_set_swing_mode(swing_mode)

View file

@ -382,13 +382,3 @@ class Thermostat(ClimateDevice):
return default
else:
return 'nextTransition'
# Sleep mode isn't used in UI yet:
# def turn_sleep_mode_on(self):
# """ Turns sleep mode on. """
# self.data.ecobee.set_climate_hold(self.thermostat_index, "sleep")
# def turn_sleep_mode_off(self):
# """ Turns sleep mode off. """
# self.data.ecobee.resume_program(self.thermostat_index)