Chips to support boolean entities (#748)

This commit is contained in:
Edward Firmo
2023-04-28 13:51:01 +02:00
committed by GitHub
parent 6bb54394a0
commit 8b06ce15aa

View File

@@ -5104,7 +5104,11 @@ action:
then:
- variables:
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: >
{% 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) }}