3.1.6.2.1. waf_tools.battery_system_config_validate.parse_battery_system_config

waf_tools.battery_system_config_validate.parse_battery_system_config(cfg: dict) → BatterySystemConfiguration

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

Extracts the #define entries for battery_system_cfg.h 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_system_cfg.json, expected to contain a files list with an entry for battery_system_cfg.h.

Returns:

A fully populated and validated BatterySystemConfiguration instance.

Raises:

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