mirror of
https://github.com/esphome/esphome.git
synced 2026-09-15 17:18:40 +00:00
Add comment explaining empty capture in effect lambda wrapper
This commit is contained in:
@@ -194,6 +194,9 @@ async def light_control_to_code(config, action_id, template_arg, args):
|
||||
config[CONF_EFFECT], args, return_type=cg.std_string
|
||||
)
|
||||
fwd_args = ", ".join(n for _, n in args)
|
||||
# capture="" is correct: paren is a global variable name
|
||||
# string-interpolated into the body at codegen time, not a
|
||||
# C++ runtime capture.
|
||||
wrapper = LambdaExpression(
|
||||
f"auto __effect_s = ({inner_lambda})({fwd_args});\n"
|
||||
f"return {paren}->get_effect_index("
|
||||
|
||||
Reference in New Issue
Block a user