Build card config from recipe
card_builder_build_from_recipeTransform a recipe shorthand into a full DocumentData config dict to create or update Home Assistant cards. Builds the block tree from recipe blocks automatically.
Instructions
Materialise a recipe shorthand into a full DocumentData (config) dict.
Builds a canvas root wrapping one block-container, recursively
turns recipe["blocks"] into the block tree via _build_block_tree
(auto-inserting block-drop-zone children for layout blocks and
auto-wrapping raw prop scalars in {"value": ...}), and returns the
assembled {version, rootId, slots, blocks} dict. Pure computation —
makes no call to Home Assistant.
Use when: turning a recipe (hand-written or from
card_builder_get_card_template) into the config to pass to
card_builder_create_card/card_builder_update_card.
Not for: hand-crafted low-level DocumentData — assemble that directly
instead; a template-driven one-shot creation — use
card_builder_make_template_card.
Returns: a dict ready to pass as config to card_builder_create_card.
Errors: raises ValueError when recipe["root_slot"] isn't defined in
recipe["slots"], when a block in recipe["blocks"] has an unknown or
internal type, or when a non-container block type is given
children.
Limits: run card_builder_validate_config on the result before
saving — this tool does not validate the produced tree itself.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| recipe | Yes | Recipe shorthand: {slots, root_slot|root_entity, blocks, root_styles, root_dz_styles, canvas_styles, action_slots, ...} — see card_builder_recipe_guide for the full shape. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||