Update __init__.py

This commit is contained in:
Otto Winter 2019-05-13 09:47:49 +02:00
parent f811b1157c
commit 02c9ada876
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E

View File

@ -24,13 +24,13 @@ def validate_optional_icon(config):
return config return config
CONFIG_SCHEMA = text_sensor.TEXT_SENSOR_SCHEMA.extend({ CONFIG_SCHEMA = cv.All(text_sensor.TEXT_SENSOR_SCHEMA.extend({
cv.GenerateID(): cv.declare_id(SunTextSensor), cv.GenerateID(): cv.declare_id(SunTextSensor),
cv.GenerateID(CONF_SUN_ID): cv.use_id(Sun), cv.GenerateID(CONF_SUN_ID): cv.use_id(Sun),
cv.Required(CONF_TYPE): cv.one_of(*SUN_TYPES, lower=True), cv.Required(CONF_TYPE): cv.one_of(*SUN_TYPES, lower=True),
cv.Optional(CONF_ELEVATION, default=0): elevation, cv.Optional(CONF_ELEVATION, default=0): elevation,
cv.Optional(CONF_FORMAT, default='%X'): cv.string_strict, cv.Optional(CONF_FORMAT, default='%X'): cv.string_strict,
}).extend(cv.polling_component_schema('60s')) }).extend(cv.polling_component_schema('60s')), validate_optional_icon)
def to_code(config): def to_code(config):