Chips to support boolean entities (#748)
This commit is contained in:
@@ -5104,7 +5104,11 @@ action:
|
|||||||
then:
|
then:
|
||||||
- variables:
|
- variables:
|
||||||
repeat_item_state: '{{ states(repeat.item.entity) | default("unavailable") }}'
|
repeat_item_state: '{{ states(repeat.item.entity) | default("unavailable") }}'
|
||||||
repeat_item_state_is_on: '{{ repeat_item_state in ["on", "open"] }}'
|
repeat_item_state_is_on: >
|
||||||
|
{{
|
||||||
|
(repeat_item_state is string and repeat_item_state in ["on", "open", "opening", "true", "True"]) or
|
||||||
|
(repeat_item_state is boolean and repeat_item_state)
|
||||||
|
}}
|
||||||
repeat_item_icon: >
|
repeat_item_icon: >
|
||||||
{% if repeat_item_state_is_on and repeat.item.icon is string and repeat.item.icon | length > 0 %}
|
{% if repeat_item_state_is_on and repeat.item.icon is string and repeat.item.icon | length > 0 %}
|
||||||
{{ all_icons[repeat.item.icon.split(":")[1]] | default(repeat.item.icon) }}
|
{{ all_icons[repeat.item.icon.split(":")[1]] | default(repeat.item.icon) }}
|
||||||
|
|||||||
Reference in New Issue
Block a user