change override config format

This commit is contained in:
joBr99
2022-03-22 22:11:08 +01:00
committed by GitHub
parent 9614b61695
commit d236ffec59
2 changed files with 5 additions and 5 deletions

View File

@@ -320,8 +320,8 @@ Only the icons listed in the [Icon Table](HMI#icons-ids) are useable.
items: items:
- light.wled - light.wled
- light.schreibtischlampe - light.schreibtischlampe
- item: switch.deckenbeleuchtung_hinten - switch.deckenbeleuchtung_hinten:
icon: lightbulb icon: lightbulb
- delete - delete
- delete - delete
- type: cardMedia - type: cardMedia

View File

@@ -148,7 +148,7 @@ class LovelaceUIPanel:
for item in items: for item in items:
# in case item is a dict, grab the item name # in case item is a dict, grab the item name
if type(item) is dict: if type(item) is dict:
cleaned_list.append(item["item"]) cleaned_list.append(next(iter(item)))
else: else:
cleaned_list.append(item) cleaned_list.append(item)
return cleaned_list return cleaned_list
@@ -443,8 +443,8 @@ class LovelaceUIPanel:
def generate_entities_item(self, item): def generate_entities_item(self, item):
icon = None icon = None
if type(item) is dict: if type(item) is dict:
icon = item["icon"] icon = next(iter(item.items()))[1]['icon']
item = item["item"] item = next(iter(item.items()))[0]
# type of the item is the string before the "." in the item name # type of the item is the string before the "." in the item name
item_type = item.split(".")[0] item_type = item.split(".")[0]