lambda condition should return (#1833)

This commit is contained in:
Guillermo Ruffino 2021-05-25 17:03:59 -03:00 committed by GitHub
parent 824f3187ac
commit 3d917d0b7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) 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): async def lambda_condition_to_code(config, condition_id, template_arg, args):
lambda_ = await cg.process_lambda(config, args, return_type=bool) lambda_ = await cg.process_lambda(config, args, return_type=bool)
return cg.new_Pvariable(condition_id, template_arg, lambda_) return cg.new_Pvariable(condition_id, template_arg, lambda_)