Skip to content

Commit

Permalink
Fix key finder (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFes authored Nov 13, 2023
1 parent 6ad1d6c commit 57aac5d
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 @@ -207,6 +207,7 @@
{%- set all = state_attr(sensor, attr_all) | default([], true) -%}
{%- set data = (today + tomorrow) or all -%}
{# Try to find the right time_key and value_key if provided parameters are not found #}
{%- set day = timedelta(days=1) -%}
{%- if data[0] | default is mapping -%}
{%- if time_key not in data[0] %}
{%- set tk_list =
Expand Down Expand Up @@ -261,7 +262,6 @@
{# convert start and end input to local datetime #}
{%- set n = now().replace(microsecond=0) -%}
{# start #}
{%- set day = timedelta(days=1) -%}
{%- if start is datetime -%}
{%- set start = start.replace(microsecond=0) | as_local -%}
{%- elif start | as_datetime is not none -%}
Expand Down

0 comments on commit 57aac5d

Please sign in to comment.