parent
656e187729
commit
9d848731d9
4 changed files with 73 additions and 72 deletions
|
@ -4,6 +4,9 @@ Support for Nest thermostats.
|
|||
For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/thermostat.nest/
|
||||
"""
|
||||
import logging
|
||||
import socket
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||
|
@ -20,14 +23,27 @@ CONFIG_SCHEMA = vol.Schema({
|
|||
})
|
||||
}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def devices():
|
||||
"""Generator returning list of devices and their location."""
|
||||
try:
|
||||
for structure in NEST.structures:
|
||||
for device in structure.devices:
|
||||
yield (structure, device)
|
||||
except socket.error:
|
||||
_LOGGER.error("Connection error logging into the nest web service.")
|
||||
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
def setup(hass, config):
|
||||
"""Setup the Nest thermostat component."""
|
||||
global NEST
|
||||
|
||||
username = config[DOMAIN].get(CONF_USERNAME)
|
||||
password = config[DOMAIN].get(CONF_PASSWORD)
|
||||
conf = config[DOMAIN]
|
||||
username = conf[CONF_USERNAME]
|
||||
password = conf[CONF_PASSWORD]
|
||||
|
||||
import nest
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue