1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00
This commit is contained in:
Otto Winter
2018-06-01 18:06:18 +02:00
parent 2d4b475951
commit 5b995c0692
11 changed files with 41 additions and 21 deletions

View File

@@ -62,7 +62,7 @@ def setup_binary_sensor_core_(binary_sensor_var, mqtt_var, config):
automation.build_automation(trigger, NoArg, conf)
for conf in config.get(CONF_ON_CLICK, []):
rhs = binary_sensor_var.make_release_trigger(conf[CONF_MIN_LENGTH], conf[CONF_MAX_LENGTH])
rhs = binary_sensor_var.make_click_trigger(conf[CONF_MIN_LENGTH], conf[CONF_MAX_LENGTH])
trigger = Pvariable(ClickTrigger, conf[CONF_TRIGGER_ID], rhs)
automation.build_automation(trigger, NoArg, conf)

View File

@@ -20,10 +20,12 @@ MakeTemplateCover = Application.MakeTemplateCover
def to_code(config):
template_ = process_lambda(config.get(CONF_LAMBDA), [])
rhs = App.make_template_cover(config[CONF_NAME], template_)
rhs = App.make_template_cover(config[CONF_NAME])
make = variable(MakeTemplateCover, config[CONF_MAKE_ID], rhs)
if CONF_LAMBDA in config:
template_ = process_lambda(config[CONF_LAMBDA], [])
add(make.Ptemplate.set_state_lambda(template_))
if CONF_OPEN_ACTION in config:
actions = automation.build_actions(config[CONF_OPEN_ACTION], NoArg)
add(make.Ptemplate_.add_open_actions(actions))

View File

@@ -20,7 +20,7 @@ def validate_frequency_bit_depth(obj):
PLATFORM_SCHEMA = vol.All(output.PLATFORM_SCHEMA.extend({
vol.Required(CONF_PIN): vol.All(pins.output_pin, vol.Range(min=0, max=33)),
vol.Required(CONF_PIN): pins.output_pin,
vol.Optional(CONF_FREQUENCY): cv.frequency,
vol.Optional(CONF_BIT_DEPTH): vol.All(vol.Coerce(int), vol.Range(min=1, max=15)),
vol.Optional(CONF_CHANNEL): vol.All(vol.Coerce(int), vol.Range(min=0, max=15))

View File

@@ -19,10 +19,12 @@ MakeTemplateSwitch = Application.MakeTemplateSwitch
def to_code(config):
template_ = process_lambda(config.get(CONF_LAMBDA), [])
rhs = App.make_template_switch(config[CONF_NAME], template_)
rhs = App.make_template_switch(config[CONF_NAME])
make = variable(MakeTemplateSwitch, config[CONF_MAKE_ID], rhs)
if CONF_LAMBDA in config:
template_ = process_lambda(config[CONF_LAMBDA], [])
add(make.Ptemplate.set_state_lambda(template_))
if CONF_TURN_OFF_ACTION in config:
actions = automation.build_actions(config[CONF_TURN_OFF_ACTION], NoArg)
add(make.Ptemplate_.add_turn_off_actions(actions))