Fix issue with scene component when using YAML aliases.
YAML aliases/anchors can make repetitive configuration sections easier to deal with. However when dealing with dictionaries, care needs to be taken to not modify the original anchor since PyYAML utilizes a reference when encountering an alias instead of a copy of the dictionary.
This commit is contained in:
1 parent
0d64f4a2d5
commit
d4b6a7343f
2 files changed
+57
-2
No files matched your search
@@ -73,8 +73,9 @@ def _process_config(scene_config):
|
||||
|
||||
for entity_id in c_entities:
|
||||
if isinstance(c_entities[entity_id], dict):
|
||||
state = c_entities[entity_id].pop('state', None)
|
||||
attributes = c_entities[entity_id]
|
||||
entity_attrs = c_entities[entity_id].copy()
|
||||
state = entity_attrs.pop('state', None)
|
||||
attributes = entity_attrs
|
||||
else:
|
||||
state = c_entities[entity_id]
|
||||
attributes = {}
|
||||
|
||||
Reference in new issue
Block a user