Fix bracket bug

This commit is contained in:
Madelena Mak 2022-07-10 08:33:20 -07:00 committed by GitHub
parent b270fed855
commit fdaf752a7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -107,7 +107,7 @@ template:
{% set cond3 = state_attr('weather.hourly', 'forecast')[3].condition %} {% set cond3 = state_attr('weather.hourly', 'forecast')[3].condition %}
{% set next_setting = as_timestamp(state_attr('sun.sun', 'next_setting')) %} {% set next_setting = as_timestamp(state_attr('sun.sun', 'next_setting')) %}
{% set next_rising = as_timestamp(state_attr('sun.sun', 'next_rising')) %} {% set next_rising = as_timestamp(state_attr('sun.sun', 'next_rising')) %}
{% set cond3_time = as_timestamp(state_attr('weather.hourly', 'forecast')[3]].datetime) %} {% set cond3_time = as_timestamp(state_attr('weather.hourly', 'forecast')[3].datetime) %}
{% if cond3_time > next_setting and cond3_time < next_rising %} {% if cond3_time > next_setting and cond3_time < next_rising %}
{% if cond3 == 'sunny' %} night {% elif cond3 == 'partlycloudy' %} night-partly-cloudy {% else %} {{ cond3 }} {% endif %} {% if cond3 == 'sunny' %} night {% elif cond3 == 'partlycloudy' %} night-partly-cloudy {% else %} {{ cond3 }} {% endif %}
{% else %} {% else %}