Add comment explaining empty capture in effect lambda wrapper

This commit is contained in:
J. Nick Koston
2026-02-24 22:33:20 -06:00
parent 08c98e8229
commit 427940f626
+3
View File
@@ -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("