Add ability to set fan made to Nest climate component (#3399)
* Add ability to set fan made to Nest climate component * Use constants for fan values * Use STATE_ON from cost * Fix lint errorpull/3258/head^2
parent
c23ad3e285
commit
d7452f9d5d
|
@ -8,9 +8,10 @@ import logging
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
import homeassistant.components.nest as nest
|
import homeassistant.components.nest as nest
|
||||||
from homeassistant.components.climate import (
|
from homeassistant.components.climate import (
|
||||||
STATE_COOL, STATE_HEAT, STATE_IDLE, ClimateDevice, PLATFORM_SCHEMA)
|
STATE_AUTO, STATE_COOL, STATE_HEAT, STATE_IDLE, ClimateDevice,
|
||||||
|
PLATFORM_SCHEMA)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
TEMP_CELSIUS, CONF_SCAN_INTERVAL, ATTR_TEMPERATURE)
|
TEMP_CELSIUS, CONF_SCAN_INTERVAL, ATTR_TEMPERATURE, STATE_ON)
|
||||||
from homeassistant.util.temperature import convert as convert_temperature
|
from homeassistant.util.temperature import convert as convert_temperature
|
||||||
|
|
||||||
DEPENDENCIES = ['nest']
|
DEPENDENCIES = ['nest']
|
||||||
|
@ -38,6 +39,7 @@ class NestThermostat(ClimateDevice):
|
||||||
self._unit = temp_unit
|
self._unit = temp_unit
|
||||||
self.structure = structure
|
self.structure = structure
|
||||||
self.device = device
|
self.device = device
|
||||||
|
self._fan_list = [STATE_ON, STATE_AUTO]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
@ -164,17 +166,18 @@ class NestThermostat(ClimateDevice):
|
||||||
self.structure.away = False
|
self.structure.away = False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_fan_on(self):
|
def current_fan_mode(self):
|
||||||
"""Return whether the fan is on."""
|
"""Return whether the fan is on."""
|
||||||
return self.device.fan
|
return STATE_ON if self.device.fan else STATE_AUTO
|
||||||
|
|
||||||
def turn_fan_on(self):
|
@property
|
||||||
"""Turn fan on."""
|
def fan_list(self):
|
||||||
self.device.fan = True
|
"""List of available fan modes."""
|
||||||
|
return self._fan_list
|
||||||
|
|
||||||
def turn_fan_off(self):
|
def set_fan_mode(self, fan):
|
||||||
"""Turn fan off."""
|
"""Turn fan on/off."""
|
||||||
self.device.fan = False
|
self.device.fan = fan.lower()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def min_temp(self):
|
def min_temp(self):
|
||||||
|
|
Loading…
Reference in New Issue