From 3d917d0b7e2679d5cc46d934dde3013ae4a529c2 Mon Sep 17 00:00:00 2001 From: Guillermo Ruffino Date: Tue, 25 May 2021 17:03:59 -0300 Subject: [PATCH] lambda condition should return (#1833) --- esphome/automation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/automation.py b/esphome/automation.py index 1cf6bbf542..71c564b906 100644 --- a/esphome/automation.py +++ b/esphome/automation.py @@ -158,7 +158,7 @@ async def not_condition_to_code(config, condition_id, template_arg, args): return cg.new_Pvariable(condition_id, template_arg, condition) -@register_condition("lambda", LambdaCondition, cv.lambda_) +@register_condition("lambda", LambdaCondition, cv.returning_lambda) async def lambda_condition_to_code(config, condition_id, template_arg, args): lambda_ = await cg.process_lambda(config, args, return_type=bool) return cg.new_Pvariable(condition_id, template_arg, lambda_)