Compare commits

...

2 Commits

Author SHA1 Message Date
1a706153a8 Fix handling of MLB rain delays, close #252 2025-06-26 17:27:26 -04:00
95b2c8cfc5 Update .HA_VERSION 2025-06-26 17:27:02 -04:00
2 changed files with 10 additions and 3 deletions

View File

@ -1 +1 @@
2025.6.1 2025.6.2

View File

@ -27,8 +27,15 @@
{% set period_str = period_str(team) %} {% set period_str = period_str(team) %}
{% set game_clock = state_attr(team,'clock') | lower %} {% set game_clock = state_attr(team,'clock') | lower %}
{% if state_attr(team,'league') == 'MLB' %} {% if state_attr(team,'league') == 'MLB' %}
{% set inning_parts = game_clock.split(' ') %} {% if 'rain delay' in game_clock %}
in the {{ inning_parts[0] ~ ' of the ' ~ inning_parts[1] ~ ' ' ~ period_str }} {# Handle cases like "Rain Delay, Top 1st" #}
{% set status, inning = game_clock.split(',', 1) %}
{% set inning_parts = inning.split(' ') %}
in a {{ status | trim }} in the {{ inning_parts[1] ~ ' of the ' ~ inning_parts[2] }} {{ period_str }}
{% else %}
{% set inning_parts = game_clock.split(' ') %}
in the {{ inning_parts[0] ~ ' of the ' ~ inning_parts[1] ~ ' ' ~ period_str }}
{% endif %}
{% else %} {% else %}
{% if ' - ' in game_clock %} {% if ' - ' in game_clock %}
{% set clock_time, quarter = game_clock.split(' - ') %} {% set clock_time, quarter = game_clock.split(' - ') %}