3.1.4.2.1. waf_tools.battery_cell_config_validate.parse_battery_cell_config

waf_tools.battery_cell_config_validate.parse_battery_cell_config(cfg: dict) → BatteryCellConfiguration

Parse a raw JSON dictionary into a validated battery cell configuration.

Extracts the #define entries for battery_cell_cfg.h and battery_cell_cfg.c from the configuration dictionary and maps them to the corresponding typed dataclasses. The define name expected for each field is derived as described in parse_defines_to_dataclass().

Parameters:

cfg – Parsed JSON content of battery_cell_cfg.json, expected to contain a files list with entries for battery_cell_cfg.h and battery_cell_cfg.c.

Returns:

A fully populated and validated BatteryCellConfiguration instance.

Raises:

InvalidBatteryCellConfigurationError – If a required define is missing or a value does not match the expected type.