Added time readout to daily announcements.

This commit is contained in:
Jeffrey Stone 2019-07-15 22:22:35 -04:00
parent e9963790ce
commit b0216d9f37
2 changed files with 24 additions and 0 deletions

View File

@ -59,6 +59,7 @@ automation:
- service: script.ah_report - service: script.ah_report
data: data:
call_interuption: 1 call_interuption: 1
call_time_annc: 1
call_prebed_routine: 1 call_prebed_routine: 1
- id: nightly_report - id: nightly_report
@ -72,6 +73,7 @@ automation:
data: data:
call_greeting: 1 call_greeting: 1
call_evening_greeting: 1 call_evening_greeting: 1
call_time_annc: 1
call_weather_alerts: 1 call_weather_alerts: 1
call_overnight_forecast: 1 call_overnight_forecast: 1
call_upcoming_holidays: 1 call_upcoming_holidays: 1
@ -89,6 +91,7 @@ automation:
data: data:
call_greeting: 1 call_greeting: 1
call_morning_greeting: 1 call_morning_greeting: 1
call_time_annc: 1
call_weather_alerts: 1 call_weather_alerts: 1
call_todays_events: 1 call_todays_events: 1
call_current_conditions_outisde: 1 call_current_conditions_outisde: 1
@ -120,6 +123,7 @@ automation:
- service: script.ah_report - service: script.ah_report
data: data:
call_interuption: 1 call_interuption: 1
call_time_annc: 1
call_skylar_dressed: 1 call_skylar_dressed: 1
call_school_today: 1 call_school_today: 1
call_skylar_events: 1 call_skylar_events: 1

View File

@ -307,6 +307,8 @@ script:
] | random }} ] | random }}
{% endmacro %} {% endmacro %}
{% macro morning_greeting() %} {% macro morning_greeting() %}
{{ [ "Anchorage House. Rise and Shine. ", {{ [ "Anchorage House. Rise and Shine. ",
"everyone. ", "everyone. ",
@ -332,6 +334,20 @@ script:
] | random }} ] | random }}
{% endmacro %} {% endmacro %}
{% macro time_annc() %}
{% if now().strftime('%H')|int < 12 %}
It is now {{ now().strftime('%H')|int }} {{ now().strftime('%M')|int }} AM.
{% elif now().strftime('%H')|int > 12 %}
It is now {{ now().strftime('%H')|int - 12 }} {{ now().strftime('%M')|int }} PM.
{% else %}
{% endif %}
{% endmacro %}
{% macro weather_alerts() %} {% macro weather_alerts() %}
There are currently {{states.sensor.nws_alerts.state }} active weather alerts for our area. There are currently {{states.sensor.nws_alerts.state }} active weather alerts for our area.
The National Weather Service Has issued, The National Weather Service Has issued,
@ -745,6 +761,10 @@ script:
{{ evening_greeting() }} {{ evening_greeting() }}
{% endif %} {% endif %}
{% if call_time_annc == 1 %}
{{ time_annc() }}
{% endif %}
{% if states.sensor.nws_alerts.state | int > 0 and call_weather_alerts == 1 %} {% if states.sensor.nws_alerts.state | int > 0 and call_weather_alerts == 1 %}
{{ weather_alerts() }} {{ weather_alerts() }}
{% endif %} {% endif %}