mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-31 18:18:27 +02:00
Perform merges when substituting dict keys (#3062)
This commit is contained in:
@@ -5,6 +5,7 @@ import esphome.config_validation as cv
|
||||
from esphome import core
|
||||
from esphome.const import CONF_SUBSTITUTIONS
|
||||
from esphome.yaml_util import ESPHomeDataBase, make_data_base
|
||||
from esphome.config_helpers import merge_config
|
||||
|
||||
CODEOWNERS = ["@esphome/core"]
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@@ -108,7 +109,7 @@ def _substitute_item(substitutions, item, path):
|
||||
if sub is not None:
|
||||
item[k] = sub
|
||||
for old, new in replace_keys:
|
||||
item[new] = item[old]
|
||||
item[new] = merge_config(item.get(old), item.get(new))
|
||||
del item[old]
|
||||
elif isinstance(item, str):
|
||||
sub = _expand_substitutions(substitutions, item, path)
|
||||
|
||||
Reference in New Issue
Block a user