8000 Update voluptuous for nest by fabaff · Pull Request #3109 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update voluptuous for nest #3109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 1, 2016
Merged
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
16 changes: 8 additions & 8 deletions homeassistant/components/binary_sensor/nest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"""
import voluptuous as vol

import homeassistant.components.nest as nest
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import (
BinarySensorDevice, PLATFORM_SCHEMA)
from homeassistant.components.sensor.nest import NestSensor
from homeassistant.const import (
CONF_PLATFORM, CONF_SCAN_INTERVAL, CONF_MONITORED_CONDITIONS
)
from homeassistant.const import (CONF_SCAN_INTERVAL, CONF_MONITORED_CONDITIONS)
import homeassistant.components.nest as nest
import homeassistant.helpers.config_validation as cv

DEPENDENCIES = ['nest']
BINARY_TYPES = ['fan',
Expand All @@ -25,11 +25,11 @@
'hvac_emer_heat_state',
'online']

PLATFORM_SCHEMA = vol.Schema({
vol.Required(CONF_PLATFORM): nest.DOMAIN,
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_SCAN_INTERVAL):
vol.All(vol.Coerce(int), vol.Range(min=1)),
vol.Required(CONF_MONITORED_CONDITIONS): [vol.In(BINARY_TYPES)],
vol.Required(CONF_MONITORED_CONDITIONS):
vol.All(cv.ensure_list, [vol.In(BINARY_TYPES)]),
})


Expand Down
7 changes: 3 additions & 4 deletions homeassistant/components/climate/nest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@

import homeassistant.components.nest as nest
from homeassistant.components.climate import (
STATE_COOL, STATE_HEAT, STATE_IDLE, ClimateDevice)
from homeassistant.const import TEMP_CELSIUS, CONF_PLATFORM, CONF_SCAN_INTERVAL
STATE_COOL, STATE_HEAT, STATE_IDLE, ClimateDevice, PLATFORM_SCHEMA)
from homeassistant.const import TEMP_CELSIUS, CONF_SCAN_INTERVAL

DEPENDENCIES = ['nest']

PLATFORM_SCHEMA = vol.Schema({
vol.Required(CONF_PLATFORM): nest.DOMAIN,
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_SCAN_INTERVAL):
vol.All(vol.Coerce(int), vol.Range(min=1)),
})
Expand Down
17 changes: 9 additions & 8 deletions homeassistant/components/nest.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
"""
Support for Nest thermostats and protect smoke alarms.
Support for Nest devices.

For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.nest/
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/nest/
"""
import logging
import socket

import voluptuous as vol

import homeassistant.helpers.config_validation as cv
from homeassistant.const import (CONF_PASSWORD, CONF_USERNAME, CONF_STRUCTURE)

from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, CONF_STRUCTURE
_LOGGER = logging.getLogger(__name__)

REQUIREMENTS = ['python-nest==2.9.2']

DOMAIN = 'nest'

NEST = None
Expand All @@ -21,14 +24,12 @@

CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Required(CONF_USERNAME): str,
vol.Required(CONF_PASSWORD): str,
vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
vol.Optional(CONF_STRUCTURE): vol.All(cv.ensure_list, cv.string)
})
}, extra=vol.ALLOW_EXTRA)

_LOGGER = logging.getLogger(__name__)


def devices():
"""Generator returning list of devices and their location."""
Expand Down
0