mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-17 02:17:01 +01:00
@@ -309,9 +309,9 @@ key | optional | type | default | description
|
|||||||
`class` | False | string | | The name of the Class.
|
`class` | False | string | | The name of the Class.
|
||||||
`config` | False | complex | | Config/Mapping between Homeassistant and your NsPanel
|
`config` | False | complex | | Config/Mapping between Homeassistant and your NsPanel
|
||||||
|
|
||||||
### Override Icons
|
### Override Icons or Names
|
||||||
|
|
||||||
To override Icons of entities you can configure an icon name in your configuration, please see the following example.
|
To override Icons or Names of entities you can configure an icon and/or name in your configuration, please see the following example.
|
||||||
Only the icons listed in the [Icon Table](HMI#icons-ids) are useable.
|
Only the icons listed in the [Icon Table](HMI#icons-ids) are useable.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@@ -322,6 +322,7 @@ Only the icons listed in the [Icon Table](HMI#icons-ids) are useable.
|
|||||||
- light.schreibtischlampe
|
- light.schreibtischlampe
|
||||||
- switch.deckenbeleuchtung_hinten:
|
- switch.deckenbeleuchtung_hinten:
|
||||||
icon: lightbulb
|
icon: lightbulb
|
||||||
|
name: Lampe
|
||||||
- delete
|
- delete
|
||||||
- delete
|
- delete
|
||||||
- type: cardMedia
|
- type: cardMedia
|
||||||
|
|||||||
@@ -433,8 +433,10 @@ class LovelaceUIPanel:
|
|||||||
|
|
||||||
def generate_entities_item(self, item):
|
def generate_entities_item(self, item):
|
||||||
icon = None
|
icon = None
|
||||||
|
name = None
|
||||||
if type(item) is dict:
|
if type(item) is dict:
|
||||||
icon = next(iter(item.items()))[1]['icon']
|
icon = next(iter(item.items()))[1].get('icon')
|
||||||
|
name = next(iter(item.items()))[1].get('name')
|
||||||
item = next(iter(item.items()))[0]
|
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
|
||||||
@@ -449,7 +451,7 @@ class LovelaceUIPanel:
|
|||||||
return f",text,{item},{get_icon_id('alert-circle-outline')},17299,Not found check, apps.yaml"
|
return f",text,{item},{get_icon_id('alert-circle-outline')},17299,Not found check, apps.yaml"
|
||||||
|
|
||||||
entity = self.api.get_entity(item)
|
entity = self.api.get_entity(item)
|
||||||
name = entity.attributes.friendly_name
|
name = name if name is not None else entity.attributes.friendly_name
|
||||||
|
|
||||||
if item_type == "cover":
|
if item_type == "cover":
|
||||||
icon_id = get_icon_id_ha("cover", state=entity.state, overwrite=icon)
|
icon_id = get_icon_id_ha("cover", state=entity.state, overwrite=icon)
|
||||||
|
|||||||
Reference in New Issue
Block a user