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

@@ -306,6 +306,8 @@ script:
"There is something that needs your attention."
] | random }}
{% endmacro %}
{% macro morning_greeting() %}
{{ [ "Anchorage House. Rise and Shine. ",
@@ -332,6 +334,20 @@ script:
] | random }}
{% 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() %}
There are currently {{states.sensor.nws_alerts.state }} active weather alerts for our area.
The National Weather Service Has issued,
@@ -745,6 +761,10 @@ script:
{{ evening_greeting() }}
{% endif %}
{% if call_time_annc == 1 %}
{{ time_annc() }}
{% endif %}
{% if states.sensor.nws_alerts.state | int > 0 and call_weather_alerts == 1 %}
{{ weather_alerts() }}
{% endif %}