Empty response gives empty list in Nord Pool (#39174)

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
This commit is contained in:
G Johansson 2025-05-26 15:12:42 +02:00 committed by GitHub
parent c07a437749
commit b6585b6b6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -241,26 +241,18 @@ template:
- name: Tomorrow lowest price
unique_id: se3_tomorrow_low_price
state: >
{% if not tomorrow_price %}
unavailable
{% else %}
{% set data = namespace(prices=[]) %}
{% for state in tomorrow_price['SE3'] %}
{% set data.prices = data.prices + [(state.price / 1000)] %}
{% endfor %}
{{min(data.prices)}}
{% endif %}
attributes:
data: >
{% if not tomorrow_price %}
[]
{% else %}
{% set data = namespace(prices=[]) %}
{% for state in tomorrow_price['SE3'] %}
{% set data.prices = data.prices + [{'start':state.start, 'end':state.end, 'price': state.price/1000}] %}
{% endfor %}
{{data.prices}}
{% endif %}
```
{% endraw %}