Fix button icon when unavailable (#660)
Button pages will show a mdi:alert-circle when an entity is unavailable, just like before.
This commit is contained in:
@@ -2405,7 +2405,7 @@ variables:
|
|||||||
scene: "\U0000EE0B" #EE0B
|
scene: "\U0000EE0B" #EE0B
|
||||||
script: "\U0000F45D" #F45D
|
script: "\U0000F45D" #F45D
|
||||||
switch: "\U0000E97D" #E97D
|
switch: "\U0000E97D" #E97D
|
||||||
unknown: "\U00000E27" #E027
|
unknown: "\U0000E027" #E027
|
||||||
weather:
|
weather:
|
||||||
lightning: "\U0000E592" #E592
|
lightning: "\U0000E592" #E592
|
||||||
protect: "\U0000F05C" #F05C
|
protect: "\U0000F05C" #F05C
|
||||||
@@ -4435,7 +4435,12 @@ action:
|
|||||||
# BRIGHTNESS Font Color
|
# BRIGHTNESS Font Color
|
||||||
btn_bri_font: "{{ btn_txt_font }}" #"{{ nextion.colors.grey_dark }}"
|
btn_bri_font: "{{ btn_txt_font }}" #"{{ nextion.colors.grey_dark }}"
|
||||||
# ICON Value
|
# ICON Value
|
||||||
btn_icon: "{{ repeat.item.icon if repeat.item.icon | length > 0 else nextion.icons.buttons[repeat.item.entity.split('.')[0] if repeat.item.entity else 'unknown'] }}"
|
btn_icon: >
|
||||||
|
{% if not current_entity_state_available %} {{ nextion.icons.buttons.unknown }}
|
||||||
|
{% elif repeat.item.icon | length > 0 %} {{ repeat.item.icon }}
|
||||||
|
{% elif repeat.item.entity and repeat.item.entity.split('.') | count > 1 %} {{ nextion.icons.buttons[repeat.item.entity.split('.')[0] if repeat.item.entity else 'unknown'] }}
|
||||||
|
{% else %} {{ nextion.icons.buttons.unknown }}
|
||||||
|
{% endif %}
|
||||||
# LABEL Value
|
# LABEL Value
|
||||||
btn_label: "{{ repeat.item.name }}"
|
btn_label: "{{ repeat.item.name }}"
|
||||||
# BRIGHTNESS Value
|
# BRIGHTNESS Value
|
||||||
|
|||||||
Reference in New Issue
Block a user