Fix dishwasher price planning template

This commit is contained in:
2026-04-06 13:04:49 +02:00
parent cd6643cd35
commit 32b4fbf6d9
+3 -3
View File
@@ -39,9 +39,9 @@
{% set total = namespace(value=0, missing=false) %}
{% for offset in range(4) %}
{% set target = base + (offset * 3600) %}
{% set match = ns.prices | selectattr('ts', 'eq', target) | list | first %}
{% if match %}
{% set total.value = total.value + (match.price | float(999)) %}
{% set matches = ns.prices | selectattr('ts', 'eq', target) | list %}
{% if matches | count > 0 %}
{% set total.value = total.value + (matches[0].price | float(999)) %}
{% else %}
{% set total.missing = true %}
{% endif %}