From 2df85a384478bcd879dd7e61746ebf974a837e06 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sun, 26 May 2019 10:31:12 +0200 Subject: [PATCH] Fix Switch Condition Fixes https://github.com/esphome/issues/issues/322 --- esphome/components/switch/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/switch/__init__.py b/esphome/components/switch/__init__.py index 6425a364a1..3870631e13 100644 --- a/esphome/components/switch/__init__.py +++ b/esphome/components/switch/__init__.py @@ -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)