esphome/esphomeyaml/components/light/__init__.py

16 lines
447 B
Python
Raw Normal View History

2018-04-07 01:23:03 +02:00
import esphomeyaml.config_validation as cv
from esphomeyaml.const import CONF_DEFAULT_TRANSITION_LENGTH
from esphomeyaml.helpers import add
2018-04-07 01:23:03 +02:00
PLATFORM_SCHEMA = cv.PLATFORM_SCHEMA.extend({
}).extend(cv.MQTT_COMMAND_COMPONENT_SCHEMA.schema)
def setup_light_component(obj, config):
2018-04-07 01:23:03 +02:00
if CONF_DEFAULT_TRANSITION_LENGTH in config:
add(obj.set_default_transition_length(config[CONF_DEFAULT_TRANSITION_LENGTH]))
2018-05-06 15:56:12 +02:00
BUILD_FLAGS = '-DUSE_LIGHT'