Fixed incorrect winning/losing statements in sports updates

This commit is contained in:
2022-12-04 15:13:02 -05:00
parent bfee681af1
commit 740a890ca8
2 changed files with 32 additions and 32 deletions

View File

@ -443,7 +443,7 @@
{% if is_state('sensor.michigan_wolverines','POST') %}
{% set date = state_attr('sensor.michigan_wolverines','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
{% if state_attr('sensor.michigan_wolverines','team_score') > state_attr('sensor.michigan_wolverines','opponent_score') %}
{% if (state_attr('sensor.michigan_wolverines','team_score') | int) > (state_attr('sensor.michigan_wolverines','opponent_score') | int) %}
"The Michigan Wolverines won their game today against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} by a score of {{ state_attr('sensor.michigan_wolverines','team_score') }} to {{ state_attr('sensor.michigan_wolverines','opponent_score') }}. "
{% else %}
"The Michigan Wolverines lost their game today against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} by a score of {{ state_attr('sensor.michigan_wolverines','opponent_score') }} to {{ state_attr('sensor.michigan_wolverines','team_score') }}. "
@ -451,7 +451,7 @@
"This brings their record to {{ state_attr('sensor.michigan_wolverines','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% elif is_state('sensor.michigan_wolverines','IN') %}
{% if state_attr('sensor.michigan_wolverines','team_score') > state_attr('sensor.michigan_wolverines','opponent_score') %}
{% if (state_attr('sensor.michigan_wolverines','team_score') | int) > (state_attr('sensor.michigan_wolverines','opponent_score') | int) %}
"The Michigan Wolverines are currently winning their game against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} with a score of {{ state_attr('sensor.michigan_wolverines','team_score') }} to {{ state_attr('sensor.michigan_wolverines','opponent_score') }}. "
{% else %}
"The Michigan Wolverines are currently losing their game against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} with a score of {{ state_attr('sensor.michigan_wolverines','opponent_score') }} to {{ state_attr('sensor.michigan_wolverines','team_score') }}. "
@ -461,7 +461,7 @@
{% if state_attr('sensor.ohio_state_buckeyes','opponent_abbr') not in ['MICH'] %}
{% set date = state_attr('sensor.ohio_state_buckeyes','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
{% if state_attr('sensor.ohio_state_buckeyes','team_score') > state_attr('sensor.ohio_state_buckeyes','opponent_score') %}
{% if (state_attr('sensor.ohio_state_buckeyes','team_score') | int) > (state_attr('sensor.ohio_state_buckeyes','opponent_score') | int) %}
"The Ohio State Buckeyes won their game today against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} by a score of {{ state_attr('sensor.ohio_state_buckeyes','team_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }}. "
{% else %}
"The Ohio State Buckeyes lost their game today against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} by a score of {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','team_score') }}. "
@ -471,7 +471,7 @@
{% endif %}
{% elif is_state('sensor.ohio_state_buckeyes','IN') %}
{% if state_attr('sensor.ohio_state_buckeyes','opponent_abbr') not in ['MICH'] %}
{% if state_attr('sensor.ohio_state_buckeyes','team_score') > state_attr('sensor.ohio_state_buckeyes','opponent_score') %}
{% if (state_attr('sensor.ohio_state_buckeyes','team_score') | int) > (state_attr('sensor.ohio_state_buckeyes','opponent_score') | int) %}
"The Ohio State Buckeyes are currently winning their game against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} with a score of {{ state_attr('sensor.ohio_state_buckeyes','team_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }}. "
{% else %}
"The Ohio State Buckeyes are currently losing their game against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} with a score of {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','team_score') }}. "
@ -481,7 +481,7 @@
{% if is_state('sensor.toledo_rockets','POST') %}
{% set date = state_attr('sensor.toledo_rockets','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
{% if state_attr('sensor.toledo_rockets','team_score') > state_attr('sensor.toledo_rockets','opponent_score') %}
{% if (state_attr('sensor.toledo_rockets','team_score') | int) > (state_attr('sensor.toledo_rockets','opponent_score') | int) %}
"The Toledo Rockets won their game today against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} by a score of {{ state_attr('sensor.toledo_rockets','team_score') }} to {{ state_attr('sensor.toledo_rockets','opponent_score') }}. "
{% else %}
"The Toledo Rockets lost their game today against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} by a score of {{ state_attr('sensor.toledo_rockets','opponent_score') }} to {{ state_attr('sensor.toledo_rockets','team_score') }}. "
@ -489,7 +489,7 @@
"This brings their record to {{ state_attr('sensor.toledo_rockets','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% elif is_state('sensor.toledo_rockets','IN') %}
{% if state_attr('sensor.toledo_rockets','team_score') > state_attr('sensor.toledo_rockets','opponent_score') %}
{% if (state_attr('sensor.toledo_rockets','team_score') | int) > (state_attr('sensor.toledo_rockets','opponent_score') | int) %}
"The Toledo Rockets are currently winning their game against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} with a score of {{ state_attr('sensor.toledo_rockets','team_score') }} to {{ state_attr('sensor.toledo_rockets','opponent_score') }}. "
{% else %}
"The Toledo Rockets are currently losing their game against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} with a score of {{ state_attr('sensor.toledo_rockets','opponent_score') }} to {{ state_attr('sensor.toledo_rockets','team_score') }}. "
@ -498,7 +498,7 @@
{% if is_state('sensor.minnesota_vikings','POST') %}
{% set date = state_attr('sensor.minnesota_vikings','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
{% if state_attr('sensor.minnesota_vikings','team_score') > state_attr('sensor.minnesota_vikings','opponent_score') %}
{% if (state_attr('sensor.minnesota_vikings','team_score') | int) > (state_attr('sensor.minnesota_vikings','opponent_score') | int) %}
"The Minnesota Vikings won their game today against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_vikings','team_score') }} to {{ state_attr('sensor.minnesota_vikings','opponent_score') }}. "
{% else %}
"The Minnesota Vikings lost their game today against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_vikings','opponent_score') }} to {{ state_attr('sensor.minnesota_vikings','team_score') }}. "
@ -506,7 +506,7 @@
"This brings their record to {{ state_attr('sensor.minnesota_vikings','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% elif is_state('sensor.minnesota_vikings','IN') %}
{% if state_attr('sensor.minnesota_vikings','team_score') > state_attr('sensor.minnesota_vikings','opponent_score') %}
{% if (state_attr('sensor.minnesota_vikings','team_score') | int) > (state_attr('sensor.minnesota_vikings','opponent_score') | int) %}
"The Minnesota Vikings are currently winning their game against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} with a score of {{ state_attr('sensor.minnesota_vikings','team_score') }} to {{ state_attr('sensor.minnesota_vikings','opponent_score') }}. "
{% else %}
"The Minnesota Vikings are currently losing their game against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} with a score of {{ state_attr('sensor.minnesota_vikings','opponent_score') }} to {{ state_attr('sensor.minnesota_vikings','team_score') }}. "
@ -515,7 +515,7 @@
{% if is_state('sensor.san_francisco_49ers','POST') %}
{% set date = state_attr('sensor.san_francisco_49ers','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
{% if state_attr('sensor.san_francisco_49ers','team_score') > state_attr('sensor.san_francisco_49ers','opponent_score') %}
{% if (state_attr('sensor.san_francisco_49ers','team_score') | int) > (state_attr('sensor.san_francisco_49ers','opponent_score') | int) %}
"The San Francisco 49ers won their game today against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} by a score of {{ state_attr('sensor.san_francisco_49ers','team_score') }} to {{ state_attr('sensor.san_francisco_49ers','opponent_score') }}. "
{% else %}
"The San Francisco 49ers lost their game today against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} by a score of {{ state_attr('sensor.san_francisco_49ers','opponent_score') }} to {{ state_attr('sensor.san_francisco_49ers','team_score') }}. "
@ -523,7 +523,7 @@
"This brings their record to {{ state_attr('sensor.san_francisco_49ers','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% elif is_state('sensor.san_francisco_49ers','IN') %}
{% if state_attr('sensor.san_francisco_49ers','team_score') > state_attr('sensor.san_francisco_49ers','opponent_score') %}
{% if (state_attr('sensor.san_francisco_49ers','team_score') | int) > (state_attr('sensor.san_francisco_49ers','opponent_score') | int) %}
"The San Francisco 49ers are currently winning their game against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} with a score of {{ state_attr('sensor.san_francisco_49ers','team_score') }} to {{ state_attr('sensor.san_francisco_49ers','opponent_score') }}. "
{% else %}
"The San Francisco 49ers are currently losing their game against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} with a score of {{ state_attr('sensor.san_francisco_49ers','opponent_score') }} to {{ state_attr('sensor.san_francisco_49ers','team_score') }}. "
@ -532,7 +532,7 @@
{% if is_state('sensor.cleveland_guardians','POST') %}
{% set date = state_attr('sensor.cleveland_guardians','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
{% if state_attr('sensor.cleveland_guardians','team_score') > state_attr('sensor.cleveland_guardians','opponent_score') %}
{% if (state_attr('sensor.cleveland_guardians','team_score') | int) > (state_attr('sensor.cleveland_guardians','opponent_score') | int) %}
"The Cleveland Guardians won their game today against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} by a score of {{ state_attr('sensor.cleveland_guardians','team_score') }} to {{ state_attr('sensor.cleveland_guardians','opponent_score') }}. "
{% else %}
"The Cleveland Guardians lost their game today against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} by a score of {{ state_attr('sensor.cleveland_guardians','opponent_score') }} to {{ state_attr('sensor.cleveland_guardians','team_score') }}. "
@ -540,7 +540,7 @@
"This brings their record to {{ state_attr('sensor.cleveland_guardians','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% elif is_state('sensor.cleveland_guardians','IN') %}
{% if state_attr('sensor.cleveland_guardians','team_score') > state_attr('sensor.cleveland_guardians','opponent_score') %}
{% if (state_attr('sensor.cleveland_guardians','team_score') | int) > (state_attr('sensor.cleveland_guardians','opponent_score') | int) %}
"The Cleveland Guardians are currently winning their game against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} with a score of {{ state_attr('sensor.cleveland_guardians','team_score') }} to {{ state_attr('sensor.cleveland_guardians','opponent_score') }}. "
{% else %}
"The Cleveland Guardians are currently losing their game against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} with a score of {{ state_attr('sensor.cleveland_guardians','opponent_score') }} to {{ state_attr('sensor.cleveland_guardians','team_score') }}. "
@ -549,7 +549,7 @@
{% if is_state('sensor.minnesota_twins','POST') %}
{% set date = state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
{% if state_attr('sensor.minnesota_twins','team_score') > state_attr('sensor.minnesota_twins','opponent_score') %}
{% if (state_attr('sensor.minnesota_twins','team_score') | int) > (state_attr('sensor.minnesota_twins','opponent_score') | int) %}
"The Minnesota Twins won their game today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_twins','team_score') }} to {{ state_attr('sensor.minnesota_twins','opponent_score') }}. "
{% else %}
"The Minnesota Twins lost their game today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_twins','opponent_score') }} to {{ state_attr('sensor.minnesota_twins','team_score') }}. "
@ -557,7 +557,7 @@
"This brings their record to {{ state_attr('sensor.minnesota_twins','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% elif is_state('sensor.minnesota_twins','IN') %}
{% if state_attr('sensor.minnesota_twins','team_score') > state_attr('sensor.minnesota_twins','opponent_score') %}
{% if (state_attr('sensor.minnesota_twins','team_score') | int) > (state_attr('sensor.minnesota_twins','opponent_score') | int) %}
"The Minnesota Twins are currently winning their game against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} with a score of {{ state_attr('sensor.minnesota_twins','team_score') }} to {{ state_attr('sensor.minnesota_twins','opponent_score') }}. "
{% else %}
"The Minnesota Twins are currently losing their game against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} with a score of {{ state_attr('sensor.minnesota_twins','opponent_score') }} to {{ state_attr('sensor.minnesota_twins','team_score') }}. "
@ -566,7 +566,7 @@
{% if is_state('sensor.los_angeles_dodgers','POST') %}
{% set date = state_attr('sensor.los_angeles_dodgers','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
{% if state_attr('sensor.los_angeles_dodgers','team_score') > state_attr('sensor.los_angeles_dodgers','opponent_score') %}
{% if (state_attr('sensor.los_angeles_dodgers','team_score') | int) > (state_attr('sensor.los_angeles_dodgers','opponent_score') | int) %}
"The Los Angeles Dodgers won their game today against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} by a score of {{ state_attr('sensor.los_angeles_dodgers','team_score') }} to {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }}. "
{% else %}
"The Los Angeles Dodgers lost their game today against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} by a score of {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }} to {{ state_attr('sensor.los_angeles_dodgers','team_score') }}. "
@ -574,7 +574,7 @@
"This brings their record to {{ state_attr('sensor.los_angeles_dodgers','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% elif is_state('sensor.los_angeles_dodgers','IN') %}
{% if state_attr('sensor.los_angeles_dodgers','team_score') > state_attr('sensor.los_angeles_dodgers','opponent_score') %}
{% if (state_attr('sensor.los_angeles_dodgers','team_score') | int) > (state_attr('sensor.los_angeles_dodgers','opponent_score') | int) %}
"The Los Angeles Dodgers are currently winning their game against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} with a score of {{ state_attr('sensor.los_angeles_dodgers','team_score') }} to {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }}. "
{% else %}
"The Los Angeles Dodgers are currently losing their game against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} with a score of {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }} to {{ state_attr('sensor.los_angeles_dodgers','team_score') }}. "

View File

@ -134,7 +134,7 @@
{% if is_state('sensor.michigan_wolverines','POST') %}
{% set date = state_attr('sensor.michigan_wolverines','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
{% if state_attr('sensor.michigan_wolverines','team_score') > state_attr('sensor.michigan_wolverines','opponent_score') %}
{% if (state_attr('sensor.michigan_wolverines','team_score') | int) > (state_attr('sensor.michigan_wolverines','opponent_score') | int) %}
"The Michigan Wolverines won their game today against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} by a score of {{ state_attr('sensor.michigan_wolverines','team_score') }} to {{ state_attr('sensor.michigan_wolverines','opponent_score') }}. "
{% else %}
"The Michigan Wolverines lost their game today against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} by a score of {{ state_attr('sensor.michigan_wolverines','opponent_score') }} to {{ state_attr('sensor.michigan_wolverines','team_score') }}. "
@ -142,7 +142,7 @@
"This brings their record to {{ state_attr('sensor.michigan_wolverines','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% elif is_state('sensor.michigan_wolverines','IN') %}
{% if state_attr('sensor.michigan_wolverines','team_score') > state_attr('sensor.michigan_wolverines','opponent_score') %}
{% if (state_attr('sensor.michigan_wolverines','team_score') | int) > (state_attr('sensor.michigan_wolverines','opponent_score') | int) %}
"The Michigan Wolverines are currently winning their game against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} with a score of {{ state_attr('sensor.michigan_wolverines','team_score') }} to {{ state_attr('sensor.michigan_wolverines','opponent_score') }}. "
{% else %}
"The Michigan Wolverines are currently losing their game against the {{ state_attr('sensor.michigan_wolverines','opponent_name') }} with a score of {{ state_attr('sensor.michigan_wolverines','opponent_score') }} to {{ state_attr('sensor.michigan_wolverines','team_score') }}. "
@ -152,7 +152,7 @@
{% if state_attr('sensor.ohio_state_buckeyes','opponent_abbr') not in ['MICH'] %}
{% set date = state_attr('sensor.ohio_state_buckeyes','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
{% if state_attr('sensor.ohio_state_buckeyes','team_score') > state_attr('sensor.ohio_state_buckeyes','opponent_score') %}
{% if (state_attr('sensor.ohio_state_buckeyes','team_score') | int) > (state_attr('sensor.ohio_state_buckeyes','opponent_score') | int) %}
"The Ohio State Buckeyes won their game today against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} by a score of {{ state_attr('sensor.ohio_state_buckeyes','team_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }}. "
{% else %}
"The Ohio State Buckeyes lost their game today against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} by a score of {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','team_score') }}. "
@ -162,7 +162,7 @@
{% endif %}
{% elif is_state('sensor.ohio_state_buckeyes','IN') %}
{% if state_attr('sensor.ohio_state_buckeyes','opponent_abbr') not in ['MICH'] %}
{% if state_attr('sensor.ohio_state_buckeyes','team_score') > state_attr('sensor.ohio_state_buckeyes','opponent_score') %}
{% if (state_attr('sensor.ohio_state_buckeyes','team_score') | int) > (state_attr('sensor.ohio_state_buckeyes','opponent_score') | int) %}
"The Ohio State Buckeyes are currently winning their game against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} with a score of {{ state_attr('sensor.ohio_state_buckeyes','team_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }}. "
{% else %}
"The Ohio State Buckeyes are currently losing their game against the {{ state_attr('sensor.ohio_state_buckeyes','opponent_name') }} with a score of {{ state_attr('sensor.ohio_state_buckeyes','opponent_score') }} to {{ state_attr('sensor.ohio_state_buckeyes','team_score') }}. "
@ -172,7 +172,7 @@
{% if is_state('sensor.toledo_rockets','POST') %}
{% set date = state_attr('sensor.toledo_rockets','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
{% if state_attr('sensor.toledo_rockets','team_score') > state_attr('sensor.toledo_rockets','opponent_score') %}
{% if (state_attr('sensor.toledo_rockets','team_score') | int) > (state_attr('sensor.toledo_rockets','opponent_score') | int) %}
"The Toledo Rockets won their game today against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} by a score of {{ state_attr('sensor.toledo_rockets','team_score') }} to {{ state_attr('sensor.toledo_rockets','opponent_score') }}. "
{% else %}
"The Toledo Rockets lost their game today against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} by a score of {{ state_attr('sensor.toledo_rockets','opponent_score') }} to {{ state_attr('sensor.toledo_rockets','team_score') }}. "
@ -180,7 +180,7 @@
"This brings their record to {{ state_attr('sensor.toledo_rockets','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% elif is_state('sensor.toledo_rockets','IN') %}
{% if state_attr('sensor.toledo_rockets','team_score') > state_attr('sensor.toledo_rockets','opponent_score') %}
{% if (state_attr('sensor.toledo_rockets','team_score') | int) > (state_attr('sensor.toledo_rockets','opponent_score') | int) %}
"The Toledo Rockets are currently winning their game against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} with a score of {{ state_attr('sensor.toledo_rockets','team_score') }} to {{ state_attr('sensor.toledo_rockets','opponent_score') }}. "
{% else %}
"The Toledo Rockets are currently losing their game against the {{ state_attr('sensor.toledo_rockets','opponent_name') }} with a score of {{ state_attr('sensor.toledo_rockets','opponent_score') }} to {{ state_attr('sensor.toledo_rockets','team_score') }}. "
@ -189,7 +189,7 @@
{% if is_state('sensor.minnesota_vikings','POST') %}
{% set date = state_attr('sensor.minnesota_vikings','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
{% if state_attr('sensor.minnesota_vikings','team_score') > state_attr('sensor.minnesota_vikings','opponent_score') %}
{% if (state_attr('sensor.minnesota_vikings','team_score') | int) > (state_attr('sensor.minnesota_vikings','opponent_score') | int) %}
"The Minnesota Vikings won their game today against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_vikings','team_score') }} to {{ state_attr('sensor.minnesota_vikings','opponent_score') }}. "
{% else %}
"The Minnesota Vikings lost their game today against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_vikings','opponent_score') }} to {{ state_attr('sensor.minnesota_vikings','team_score') }}. "
@ -197,7 +197,7 @@
"This brings their record to {{ state_attr('sensor.minnesota_vikings','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% elif is_state('sensor.minnesota_vikings','IN') %}
{% if state_attr('sensor.minnesota_vikings','team_score') > state_attr('sensor.minnesota_vikings','opponent_score') %}
{% if (state_attr('sensor.minnesota_vikings','team_score') | int) > (state_attr('sensor.minnesota_vikings','opponent_score') | int) %}
"The Minnesota Vikings are currently winning their game against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} with a score of {{ state_attr('sensor.minnesota_vikings','team_score') }} to {{ state_attr('sensor.minnesota_vikings','opponent_score') }}. "
{% else %}
"The Minnesota Vikings are currently losing their game against the {{ state_attr('sensor.minnesota_vikings','opponent_name') }} with a score of {{ state_attr('sensor.minnesota_vikings','opponent_score') }} to {{ state_attr('sensor.minnesota_vikings','team_score') }}. "
@ -206,7 +206,7 @@
{% if is_state('sensor.san_francisco_49ers','POST') %}
{% set date = state_attr('sensor.san_francisco_49ers','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
{% if state_attr('sensor.san_francisco_49ers','team_score') > state_attr('sensor.san_francisco_49ers','opponent_score') %}
{% if (state_attr('sensor.san_francisco_49ers','team_score') | int) > (state_attr('sensor.san_francisco_49ers','opponent_score') | int) %}
"The San Francisco 49ers won their game today against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} by a score of {{ state_attr('sensor.san_francisco_49ers','team_score') }} to {{ state_attr('sensor.san_francisco_49ers','opponent_score') }}. "
{% else %}
"The San Francisco 49ers lost their game today against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} by a score of {{ state_attr('sensor.san_francisco_49ers','opponent_score') }} to {{ state_attr('sensor.san_francisco_49ers','team_score') }}. "
@ -214,7 +214,7 @@
"This brings their record to {{ state_attr('sensor.san_francisco_49ers','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% elif is_state('sensor.san_francisco_49ers','IN') %}
{% if state_attr('sensor.san_francisco_49ers','team_score') > state_attr('sensor.san_francisco_49ers','opponent_score') %}
{% if (state_attr('sensor.san_francisco_49ers','team_score') | int) > (state_attr('sensor.san_francisco_49ers','opponent_score') | int) %}
"The San Francisco 49ers are currently winning their game against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} with a score of {{ state_attr('sensor.san_francisco_49ers','team_score') }} to {{ state_attr('sensor.san_francisco_49ers','opponent_score') }}. "
{% else %}
"The San Francisco 49ers are currently losing their game against the {{ state_attr('sensor.san_francisco_49ers','opponent_name') }} with a score of {{ state_attr('sensor.san_francisco_49ers','opponent_score') }} to {{ state_attr('sensor.san_francisco_49ers','team_score') }}. "
@ -223,7 +223,7 @@
{% if is_state('sensor.cleveland_guardians','POST') %}
{% set date = state_attr('sensor.cleveland_guardians','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
{% if state_attr('sensor.cleveland_guardians','team_score') > state_attr('sensor.cleveland_guardians','opponent_score') %}
{% if (state_attr('sensor.cleveland_guardians','team_score') | int) > (state_attr('sensor.cleveland_guardians','opponent_score') | int) %}
"The Cleveland Guardians won their game today against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} by a score of {{ state_attr('sensor.cleveland_guardians','team_score') }} to {{ state_attr('sensor.cleveland_guardians','opponent_score') }}. "
{% else %}
"The Cleveland Guardians lost their game today against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} by a score of {{ state_attr('sensor.cleveland_guardians','opponent_score') }} to {{ state_attr('sensor.cleveland_guardians','team_score') }}. "
@ -231,7 +231,7 @@
"This brings their record to {{ state_attr('sensor.cleveland_guardians','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% elif is_state('sensor.cleveland_guardians','IN') %}
{% if state_attr('sensor.cleveland_guardians','team_score') > state_attr('sensor.cleveland_guardians','opponent_score') %}
{% if (state_attr('sensor.cleveland_guardians','team_score') | int) > (state_attr('sensor.cleveland_guardians','opponent_score') | int) %}
"The Cleveland Guardians are currently winning their game against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} with a score of {{ state_attr('sensor.cleveland_guardians','team_score') }} to {{ state_attr('sensor.cleveland_guardians','opponent_score') }}. "
{% else %}
"The Cleveland Guardians are currently losing their game against the {{ state_attr('sensor.cleveland_guardians','opponent_name') }} with a score of {{ state_attr('sensor.cleveland_guardians','opponent_score') }} to {{ state_attr('sensor.cleveland_guardians','team_score') }}. "
@ -240,7 +240,7 @@
{% if is_state('sensor.minnesota_twins','POST') %}
{% set date = state_attr('sensor.minnesota_twins','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
{% if state_attr('sensor.minnesota_twins','team_score') > state_attr('sensor.minnesota_twins','opponent_score') %}
{% if (state_attr('sensor.minnesota_twins','team_score') | int) > (state_attr('sensor.minnesota_twins','opponent_score') | int) %}
"The Minnesota Twins won their game today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_twins','team_score') }} to {{ state_attr('sensor.minnesota_twins','opponent_score') }}. "
{% else %}
"The Minnesota Twins lost their game today against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} by a score of {{ state_attr('sensor.minnesota_twins','opponent_score') }} to {{ state_attr('sensor.minnesota_twins','team_score') }}. "
@ -248,7 +248,7 @@
"This brings their record to {{ state_attr('sensor.minnesota_twins','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% elif is_state('sensor.minnesota_twins','IN') %}
{% if state_attr('sensor.minnesota_twins','team_score') > state_attr('sensor.minnesota_twins','opponent_score') %}
{% if (state_attr('sensor.minnesota_twins','team_score') | int) > (state_attr('sensor.minnesota_twins','opponent_score') | int) %}
"The Minnesota Twins are currently winning their game against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} with a score of {{ state_attr('sensor.minnesota_twins','team_score') }} to {{ state_attr('sensor.minnesota_twins','opponent_score') }}. "
{% else %}
"The Minnesota Twins are currently losing their game against the {{ state_attr('sensor.minnesota_twins','opponent_name') }} with a score of {{ state_attr('sensor.minnesota_twins','opponent_score') }} to {{ state_attr('sensor.minnesota_twins','team_score') }}. "
@ -257,7 +257,7 @@
{% if is_state('sensor.los_angeles_dodgers','POST') %}
{% set date = state_attr('sensor.los_angeles_dodgers','date') | as_timestamp | timestamp_custom('%m-%d') %}
{% if date == now().strftime('%m-%d') %}
{% if state_attr('sensor.los_angeles_dodgers','team_score') > state_attr('sensor.los_angeles_dodgers','opponent_score') %}
{% if (state_attr('sensor.los_angeles_dodgers','team_score') | int) > (state_attr('sensor.los_angeles_dodgers','opponent_score') | int) %}
"The Los Angeles Dodgers won their game today against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} by a score of {{ state_attr('sensor.los_angeles_dodgers','team_score') }} to {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }}. "
{% else %}
"The Los Angeles Dodgers lost their game today against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} by a score of {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }} to {{ state_attr('sensor.los_angeles_dodgers','team_score') }}. "
@ -265,7 +265,7 @@
"This brings their record to {{ state_attr('sensor.los_angeles_dodgers','team_record') | replace("-"," and ") }} on the season. "
{% endif %}
{% elif is_state('sensor.los_angeles_dodgers','IN') %}
{% if state_attr('sensor.los_angeles_dodgers','team_score') > state_attr('sensor.los_angeles_dodgers','opponent_score') %}
{% if (state_attr('sensor.los_angeles_dodgers','team_score') | int) > (state_attr('sensor.los_angeles_dodgers','opponent_score') | int) %}
"The Los Angeles Dodgers are currently winning their game against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} with a score of {{ state_attr('sensor.los_angeles_dodgers','team_score') }} to {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }}. "
{% else %}
"The Los Angeles Dodgers are currently losing their game against the {{ state_attr('sensor.los_angeles_dodgers','opponent_name') }} with a score of {{ state_attr('sensor.los_angeles_dodgers','opponent_score') }} to {{ state_attr('sensor.los_angeles_dodgers','team_score') }}. "