Try to fix the Flag sensor.

This commit is contained in:
ccostan 2018-07-04 23:22:49 -04:00
parent 595fabdb84
commit 0d889da2b6
1 changed files with 2 additions and 2 deletions

View File

@ -39,14 +39,14 @@ sensor:
{{ holiday }}
- platform: rest
resource: http://www.webcal.fi/cal.php?id=335&format=json&start_year=current_year&end_year=2018&tz=America%2FNew_York
resource: http://www.webcal.fi/cal.php?id=335&format=json&start_year=current_year&end_year=2020&tz=America%2FNew_York
name: Flag
scan_interval: 14400
value_template: >-
{% set is_flag_day = False %}
{%- for day_val in value_json -%}
{% set now_string = now().strftime('%Y-%m-%d') %}
{%- if day_val.date == now_string and day_val.flag_day == 1-%}
{%- if day_val.date==now_string and day_val.flag_day==1 -%}
{% set is_flag_day = True %}
{%- endif -%}
{% endfor %}