I have code to create an array, 24 values 1 for each hour
The starting value af the array depends on the time on that moment.
now I want to adjust the code so it outputs 48 values 1 for each 30 minutes
below the code for the 24 values depending on the day of the week the data in the array changes
{% if now().weekday() == 5 or now().weekday() == 6 %}
{%- set load_cost = [0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115] %}
{%- else -%}
{%- set load_cost = [2,0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.115, 0.115] %}
{%- endif %}
{%- set values_all = namespace(all=[]) %}
{% for i in range(load_cost | length) %}
{%- set v = load_cost[i] | float %}
{%- set values_all.all = values_all.all + [v] %}
{%- endfor %} {{ (values_all.all)[now().hour:24] + (values_all.all)[0:now().hour] }}
So I want in stead of an output like this
[0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.115, 0.115]
I want this
[0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.115, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.115, 0.115, 0.115, 0.115]
Thx in advance