Use schema validators already avaialble

This commit is contained in:
Teagan M. Glenn 2016-08-18 10:37:26 -06:00
parent 6f57d36134
commit ddec28da4b

View file

@ -11,7 +11,7 @@ import requests
import voluptuous as vol
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.config_validation import ensure_list
from homeassistant.helpers.config_validation import (ensure_list, string)
from homeassistant.util import Throttle
from homeassistant.const import (CONF_PLATFORM, CONF_MONITORED_CONDITIONS,
CONF_API_KEY, TEMP_FAHRENHEIT, TEMP_CELSIUS,
@ -57,8 +57,8 @@ SENSOR_TYPES = {
PLATFORM_SCHEMA = vol.Schema({
vol.Required(CONF_PLATFORM): "wunderground",
vol.Required(CONF_API_KEY): vol.Coerce(str),
CONF_PWS_ID: vol.Coerce(str),
vol.Required(CONF_API_KEY): string,
vol.Optional(CONF_PWS_ID): string,
vol.Required(CONF_MONITORED_CONDITIONS,
default=[]): vol.All(ensure_list, [vol.In(SENSOR_TYPES)]),
})