mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 12:27:13 +01:00
Fix Switch Condition
Fixes https://github.com/esphome/issues/issues/322
This commit is contained in:
parent
9ed06444e1
commit
d8963ea25a
@ -83,13 +83,13 @@ def switch_toggle_to_code(config, action_id, template_arg, args):
|
||||
@automation.register_condition('switch.is_on', SwitchCondition, SWITCH_ACTION_SCHEMA)
|
||||
def switch_is_on_to_code(config, condition_id, template_arg, args):
|
||||
paren = yield cg.get_variable(config[CONF_ID])
|
||||
yield cg.new_Pvariable(condition_id, template_arg, paren)
|
||||
yield cg.new_Pvariable(condition_id, template_arg, paren, True)
|
||||
|
||||
|
||||
@automation.register_condition('switch.is_off', SwitchCondition, SWITCH_ACTION_SCHEMA)
|
||||
def switch_is_off_to_code(config, condition_id, template_arg, args):
|
||||
paren = yield cg.get_variable(config[CONF_ID])
|
||||
yield cg.new_Pvariable(condition_id, template_arg, paren)
|
||||
yield cg.new_Pvariable(condition_id, template_arg, paren, False)
|
||||
|
||||
|
||||
@coroutine_with_priority(100.0)
|
||||
|
Loading…
Reference in New Issue
Block a user