From 32b4fbf6d994e3006fa8c2cea2d8feef1e31b8cb Mon Sep 17 00:00:00 2001 From: Claus Dethlefsen Date: Mon, 6 Apr 2026 13:04:49 +0200 Subject: [PATCH] Fix dishwasher price planning template --- include/automations/opvaskemaskine.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/automations/opvaskemaskine.yaml b/include/automations/opvaskemaskine.yaml index 36879ba..c3bc2d7 100644 --- a/include/automations/opvaskemaskine.yaml +++ b/include/automations/opvaskemaskine.yaml @@ -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 %}