mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 16:38:16 +01:00
[core] Fix package merging with lists of primitives (#6952)
This commit is contained in:
parent
1863523cfd
commit
a21dab334c
1 changed files with 7 additions and 3 deletions
|
@ -58,17 +58,21 @@ def merge_config(full_old, full_new):
|
||||||
ids = {
|
ids = {
|
||||||
v_id: i
|
v_id: i
|
||||||
for i, v in enumerate(res)
|
for i, v in enumerate(res)
|
||||||
if (v_id := v.get(CONF_ID)) and isinstance(v_id, str)
|
if isinstance(v, dict)
|
||||||
|
and (v_id := v.get(CONF_ID))
|
||||||
|
and isinstance(v_id, str)
|
||||||
}
|
}
|
||||||
extend_ids = {
|
extend_ids = {
|
||||||
v_id.value: i
|
v_id.value: i
|
||||||
for i, v in enumerate(res)
|
for i, v in enumerate(res)
|
||||||
if (v_id := v.get(CONF_ID)) and isinstance(v_id, Extend)
|
if isinstance(v, dict)
|
||||||
|
and (v_id := v.get(CONF_ID))
|
||||||
|
and isinstance(v_id, Extend)
|
||||||
}
|
}
|
||||||
|
|
||||||
ids_to_delete = []
|
ids_to_delete = []
|
||||||
for v in new:
|
for v in new:
|
||||||
if new_id := v.get(CONF_ID):
|
if isinstance(v, dict) and (new_id := v.get(CONF_ID)):
|
||||||
if isinstance(new_id, Extend):
|
if isinstance(new_id, Extend):
|
||||||
new_id = new_id.value
|
new_id = new_id.value
|
||||||
if new_id in ids:
|
if new_id in ids:
|
||||||
|
|
Loading…
Reference in a new issue