mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-07 21:33:32 +02:00
lambda condition should return (#1833)
This commit is contained in:
committed by
GitHub
parent
824f3187ac
commit
3d917d0b7e
@@ -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_)
|
||||||
|
|||||||
Reference in New Issue
Block a user