mirror of
https://github.com/esphome/esphome.git
synced 2026-09-14 08:38:39 +00:00
Add comment explaining RawExpression usage
This commit is contained in:
@@ -701,4 +701,7 @@ async def build_callback_automation(
|
||||
# data in the struct.
|
||||
if forwarder is None:
|
||||
forwarder = TriggerForwarder.template(templ)
|
||||
# RawExpression for aggregate init — both forwarder and obj are codegen
|
||||
# MockObjs (not user input), and there's no Expression type for positional
|
||||
# aggregate initialization (StructInitializer uses named fields).
|
||||
cg.add(getattr(parent, callback_method)(cg.RawExpression(f"{forwarder}{{{obj}}}")))
|
||||
|
||||
Reference in New Issue
Block a user