Skip to content

Commit

Permalink
Bugfix for extreme_now (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFes authored Feb 16, 2024
1 parent 6878b09 commit c89df64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cheapest_energy_hours.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@
if lowest
else values | map(attribute=value_key) | max - pt
-%}
{%- set current_price = values | sort(attribute=time_key, reverse=true) | selectattr(time_key, '<=', now()) | map(attribute=value_key) | list | first -%}
{%- set current_price = data | sort(attribute=time_key, reverse=true) | selectattr(time_key, '<=', now()) | map(attribute=value_key) | list | first | default(99 if lowest else 0) -%}
{%- set output.extreme_now = current_price <= compare_price if lowest else current_price >= compare_price -%}
{#- output date based on the selected mode -#}
{%- if mode == 'all' -%}
Expand Down

0 comments on commit c89df64

Please sign in to comment.