From 02c9ada876f087d2cf551cd13fd9e391730f32e1 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Mon, 13 May 2019 09:47:49 +0200 Subject: [PATCH] Update __init__.py --- esphome/components/sun/text_sensor/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/sun/text_sensor/__init__.py b/esphome/components/sun/text_sensor/__init__.py index 8102a24da5..9a82a3d75f 100644 --- a/esphome/components/sun/text_sensor/__init__.py +++ b/esphome/components/sun/text_sensor/__init__.py @@ -24,13 +24,13 @@ def validate_optional_icon(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(CONF_SUN_ID): cv.use_id(Sun), cv.Required(CONF_TYPE): cv.one_of(*SUN_TYPES, lower=True), cv.Optional(CONF_ELEVATION, default=0): elevation, 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):