diff --git a/homeassistant/components/wemo.py b/homeassistant/components/wemo.py index 00a7017fa0f..5fe124aaf45 100644 --- a/homeassistant/components/wemo.py +++ b/homeassistant/components/wemo.py @@ -6,8 +6,12 @@ https://home-assistant.io/components/wemo/ """ import logging +import voluptuous as vol + from homeassistant.components.discovery import SERVICE_WEMO from homeassistant.helpers import discovery +from homeassistant.helpers import config_validation as cv + from homeassistant.const import EVENT_HOMEASSISTANT_STOP REQUIREMENTS = ['pywemo==0.4.5'] @@ -29,6 +33,14 @@ KNOWN_DEVICES = [] _LOGGER = logging.getLogger(__name__) +CONF_STATIC = 'static' + +CONFIG_SCHEMA = vol.Schema({ + DOMAIN: vol.Schema({ + vol.Optional(CONF_STATIC, default=[]): vol.Schema([cv.string]) + }), +}, extra=vol.ALLOW_EXTRA) + # pylint: disable=unused-argument, too-many-function-args def setup(hass, config): @@ -69,7 +81,7 @@ def setup(hass, config): # Add static devices from the config file. devices.extend((address, None) - for address in config.get(DOMAIN, {}).get('static', [])) + for address in config.get(DOMAIN, {}).get(CONF_STATIC)) for address, device in devices: port = pywemo.ouimeaux_device.probe_wemo(address)