Sensor for if a monitored sports team has an event today

This commit is contained in:
2023-08-23 19:42:44 -04:00
parent 52acea2558
commit 359aa7e7a8
2 changed files with 52 additions and 1 deletions

View File

@ -65,3 +65,14 @@
'weeks' in state_attr(team,'kickoff_in') }}
{% endif %}
{% endmacro %}
{% macro sports_today(team) %}
{% if states(team) != 'NOT_FOUND' %}
{% set date = state_attr(team,'date') | as_timestamp | timestamp_custom('%m-%d') %}
{% else %}
{% set date = 'none' %}
{% endif %}
{% if date == now().strftime('%m-%d') %}
{{ states(team) in ['PRE','IN'] }}
{% endif %}
{% endmacro %}