2018-04-07 01:23:03 +02:00
|
|
|
import esphomeyaml.config_validation as cv
|
2018-05-14 11:50:56 +02:00
|
|
|
from esphomeyaml.const import CONF_DEFAULT_TRANSITION_LENGTH, CONF_GAMMA_CORRECT
|
2018-04-18 18:43:13 +02:00
|
|
|
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)
|
|
|
|
|
|
|
|
|
2018-04-18 18:43:13 +02:00
|
|
|
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-14 11:50:56 +02:00
|
|
|
if CONF_GAMMA_CORRECT in config:
|
|
|
|
add(obj.set_gamma_correct(config[CONF_GAMMA_CORRECT]))
|
2018-04-18 18:43:13 +02:00
|
|
|
|
|
|
|
|
2018-05-06 15:56:12 +02:00
|
|
|
BUILD_FLAGS = '-DUSE_LIGHT'
|