core/homeassistant/components/nest.py

37 lines
793 B
Python
Raw Normal View History

"""
2016-03-07 17:49:31 +00:00
Support for Nest thermostats.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/thermostat.nest/
"""
2016-04-01 14:31:11 +00:00
import voluptuous as vol
2016-02-19 05:27:50 +00:00
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
REQUIREMENTS = ['python-nest==2.6.0']
DOMAIN = 'nest'
NEST = None
2016-04-01 14:31:11 +00:00
CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Required(CONF_USERNAME): str,
vol.Required(CONF_PASSWORD): str
})
}, extra=vol.ALLOW_EXTRA)
# pylint: disable=unused-argument
def setup(hass, config):
2016-03-07 17:49:31 +00:00
"""Setup the Nest thermostat component."""
global NEST
username = config[DOMAIN].get(CONF_USERNAME)
password = config[DOMAIN].get(CONF_PASSWORD)
2016-01-14 21:17:28 +00:00
import nest
NEST = nest.Nest(username, password)
return True