Skip to content

Commit

Permalink
Make home page sensor's icons consistent
Browse files Browse the repository at this point in the history
Make icon selection consistent with chips where the entity's icon is used in case a icon is not set in the blueprint settings.

Solves #963
  • Loading branch information
edwardtfn committed Aug 4, 2023
1 parent 9979058 commit 4971b75
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nspanel_blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6852,13 +6852,15 @@ action:
data:
component: '{{ repeat.item.page }}.{{ repeat.item.component }}_icon'
message: >
{% if repeat.item.icon is string %}
{% if repeat.item.icon is string and repeat.item.icon | length > 0 %}
{{
all_icons[repeat.item.icon.split(":")[1]] | default(all_icons.unknown)
if repeat.item.icon.split(":") | count > 0
else repeat.item.icon
}}
{% else %}{{ all_icons.unknown }}
{% elif state_attr(repeat.item.entity, "icon") | default("") not in ["unavailable", "unknown", "", None] %}
{{ all_icons[state_attr(repeat.item.entity, "icon").split(":")[1]] | default(all_icons.unknown) }}
{% else %}{{ all_icons.blank }}
{% endif %}
continue_on_error: true
- variables:
Expand Down

0 comments on commit 4971b75

Please sign in to comment.