what is wrong in my script, i never get …count > 0 when add the same item?
sequence:
- variables:
var: "{{ variables.todoitems }}"
- repeat:
for_each: "{{ var.split(',') }}"
sequence:
- if:
- condition: or
conditions:
- condition: template
value_template: "{{ '+' in repeat.item }}"
- condition: template
value_template: "{{['todo.todoliste']['items']|selectattr('summary','search',repeat.item)|list|count > 0}}"
then: null
else:
- action: todo.add_item
metadata: {}
data:
item: "{{repeat.item}}"
due_date: "{{ (now() + timedelta(days=1)).strftime('%Y-%m-%d') }}"
target:
entity_id: todo.todoliste
alias: todo_add_items
description: ""