From a21dab334c48da775189085d7206fe88ecdaa3a5 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Fri, 21 Jun 2024 13:09:00 +1200 Subject: [PATCH] [core] Fix package merging with lists of primitives (#6952) --- esphome/config_helpers.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/esphome/config_helpers.py b/esphome/config_helpers.py index b5e0b26143..54242bc259 100644 --- a/esphome/config_helpers.py +++ b/esphome/config_helpers.py @@ -58,17 +58,21 @@ def merge_config(full_old, full_new): ids = { v_id: i 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 = { v_id.value: i 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 = [] 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): new_id = new_id.value if new_id in ids: