mirror of
https://github.com/esphome/esphome.git
synced 2025-09-25 06:32:22 +01:00
Updates
This commit is contained in:
@@ -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))
|
||||
|
Reference in New Issue
Block a user