Add voluptuous to ecobee (#3257)

This commit is contained in:
Pascal Vizeli authored and Fabian Affolter committed 2016-09-08 16:11:00 +02:00
1 parent 1af5d4c8b8
commit 24aa3b3c97
1 file changed
+14 -2
+14 -2
View File
@@ -5,16 +5,28 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.ecobee/
"""
import logging
import voluptuous as vol
from homeassistant.components import ecobee
from homeassistant.components.notify import BaseNotificationService
from homeassistant.components.notify import (
BaseNotificationService, PLATFORM_SCHEMA) # NOQA
import homeassistant.helpers.config_validation as cv
DEPENDENCIES = ['ecobee']
_LOGGER = logging.getLogger(__name__)
CONF_INDEX = 'index'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_INDEX, default=0): cv.positive_int,
})
def get_service(hass, config):
"""Get the Ecobee notification service."""
index = int(config['index']) if 'index' in config else 0
index = config.get(CONF_INDEX)
return EcobeeNotificationService(index)