[config] Fix crash with empty substitutions block (#7612)

This commit is contained in:
Clyde Stubbs 2024-10-17 11:32:22 +11:00 committed by Jesse Hills
parent d6b96ad51d
commit 7004053538
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A

View File

@ -782,7 +782,7 @@ def validate_config(
from esphome.components import substitutions
result[CONF_SUBSTITUTIONS] = {
**config.get(CONF_SUBSTITUTIONS, {}),
**(config.get(CONF_SUBSTITUTIONS) or {}),
**command_line_substitutions,
}
result.add_output_path([CONF_SUBSTITUTIONS], CONF_SUBSTITUTIONS)