mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 19:57:07 +00:00
Lovelace fix: badges are removed from view after update (#18983)
* badges are removed from view after update * Only add badges and cards when not provided in new config
This commit is contained in:
parent
d8a7e9ded8
commit
75b855ef93
@ -380,7 +380,10 @@ def update_view(fname: str, view_id: str, view_config, data_format:
|
||||
"View with ID: {} was not found in {}.".format(view_id, fname))
|
||||
if data_format == FORMAT_YAML:
|
||||
view_config = yaml.yaml_to_object(view_config)
|
||||
view_config['cards'] = found.get('cards', [])
|
||||
if not view_config.get('cards') and found.get('cards'):
|
||||
view_config['cards'] = found.get('cards', [])
|
||||
if not view_config.get('badges') and found.get('badges'):
|
||||
view_config['badges'] = found.get('badges', [])
|
||||
found.clear()
|
||||
found.update(view_config)
|
||||
yaml.save_yaml(fname, config)
|
||||
|
Loading…
x
Reference in New Issue
Block a user