mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 05:46:52 +00:00
Empty response gives empty list in Nord Pool (#39174)
Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
This commit is contained in:
parent
c07a437749
commit
b6585b6b6b
@ -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 %}
|
||||
{% set data = namespace(prices=[]) %}
|
||||
{% for state in tomorrow_price['SE3'] %}
|
||||
{% set data.prices = data.prices + [(state.price / 1000)] %}
|
||||
{% endfor %}
|
||||
{{min(data.prices)}}
|
||||
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 %}
|
||||
{% 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}}
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user