mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 08:28:12 +01:00
Fix output actions
This commit is contained in:
parent
08c16020c6
commit
e9d9de448e
1 changed files with 18 additions and 18 deletions
|
@ -50,29 +50,13 @@ BUILD_FLAGS = '-DUSE_OUTPUT'
|
||||||
|
|
||||||
|
|
||||||
CONF_OUTPUT_TURN_ON = 'output.turn_on'
|
CONF_OUTPUT_TURN_ON = 'output.turn_on'
|
||||||
OUTPUT_TURN_OFF_ACTION = maybe_simple_id({
|
OUTPUT_TURN_ON_ACTION = maybe_simple_id({
|
||||||
vol.Required(CONF_ID): cv.use_variable_id(None),
|
vol.Required(CONF_ID): cv.use_variable_id(None),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ACTION_REGISTRY.register(CONF_OUTPUT_TURN_ON, OUTPUT_TURN_OFF_ACTION)
|
@ACTION_REGISTRY.register(CONF_OUTPUT_TURN_ON, OUTPUT_TURN_ON_ACTION)
|
||||||
def output_turn_on_to_code(config, action_id, arg_type):
|
def output_turn_on_to_code(config, action_id, arg_type):
|
||||||
template_arg = TemplateArguments(arg_type)
|
|
||||||
for var in get_variable(config[CONF_ID]):
|
|
||||||
yield None
|
|
||||||
rhs = var.make_turn_off_action(template_arg)
|
|
||||||
type = TurnOffAction.template(arg_type)
|
|
||||||
yield Pvariable(action_id, rhs, type=type)
|
|
||||||
|
|
||||||
|
|
||||||
CONF_OUTPUT_TURN_OFF = 'output.turn_off'
|
|
||||||
OUTPUT_TURN_ON_ACTION = maybe_simple_id({
|
|
||||||
vol.Required(CONF_ID): cv.use_variable_id(None)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
@ACTION_REGISTRY.register(CONF_OUTPUT_TURN_OFF, OUTPUT_TURN_ON_ACTION)
|
|
||||||
def output_turn_off_to_code(config, action_id, arg_type):
|
|
||||||
template_arg = TemplateArguments(arg_type)
|
template_arg = TemplateArguments(arg_type)
|
||||||
for var in get_variable(config[CONF_ID]):
|
for var in get_variable(config[CONF_ID]):
|
||||||
yield None
|
yield None
|
||||||
|
@ -81,6 +65,22 @@ def output_turn_off_to_code(config, action_id, arg_type):
|
||||||
yield Pvariable(action_id, rhs, type=type)
|
yield Pvariable(action_id, rhs, type=type)
|
||||||
|
|
||||||
|
|
||||||
|
CONF_OUTPUT_TURN_OFF = 'output.turn_off'
|
||||||
|
OUTPUT_TURN_OFF_ACTION = maybe_simple_id({
|
||||||
|
vol.Required(CONF_ID): cv.use_variable_id(None)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ACTION_REGISTRY.register(CONF_OUTPUT_TURN_OFF, OUTPUT_TURN_OFF_ACTION)
|
||||||
|
def output_turn_off_to_code(config, action_id, arg_type):
|
||||||
|
template_arg = TemplateArguments(arg_type)
|
||||||
|
for var in get_variable(config[CONF_ID]):
|
||||||
|
yield None
|
||||||
|
rhs = var.make_turn_off_action(template_arg)
|
||||||
|
type = TurnOffAction.template(arg_type)
|
||||||
|
yield Pvariable(action_id, rhs, type=type)
|
||||||
|
|
||||||
|
|
||||||
CONF_OUTPUT_SET_LEVEL = 'output.set_level'
|
CONF_OUTPUT_SET_LEVEL = 'output.set_level'
|
||||||
OUTPUT_SET_LEVEL_ACTION = vol.Schema({
|
OUTPUT_SET_LEVEL_ACTION = vol.Schema({
|
||||||
vol.Required(CONF_ID): cv.use_variable_id(None),
|
vol.Required(CONF_ID): cv.use_variable_id(None),
|
||||||
|
|
Loading…
Reference in a new issue