mirror of
https://github.com/thejeffreystone/home-assistant-configuration.git
synced 2025-08-29 09:04:46 +00:00
Too many updates to cover
This commit is contained in:
33
templates/jeff_home_annc.yaml
Executable file
33
templates/jeff_home_annc.yaml
Executable file
@@ -0,0 +1,33 @@
|
||||
>
|
||||
{% macro getIntro() %}
|
||||
{{ [
|
||||
"Pardon me,",
|
||||
"Excuse me,",
|
||||
"I do not mean to interupt, but.",
|
||||
"I thought you might like to know."
|
||||
] | random }}
|
||||
{% endmacro %}
|
||||
{% macro getMessage() %}
|
||||
{{ [
|
||||
"Jeff has arrived.",
|
||||
"Jeff is in the neighborhood.",
|
||||
"Jeff is arriving.",
|
||||
"Jeff has finally made it home."
|
||||
] | random }}
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
{# a macro that removes all newline characters, empty spaces, and returns formatted text #}
|
||||
{%- macro cleanup(data) -%}
|
||||
{%- for item in data.split("\n") if item | trim != "" -%}
|
||||
{{ item | trim }} {% endfor -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
{# a macro to call all macros :) #}
|
||||
{%- macro mother_of_all_macros() -%}
|
||||
{{ getIntro() }}
|
||||
{{ getMessage() }}
|
||||
{%- endmacro -%}
|
||||
|
||||
{# Call the macro #}
|
||||
{{- cleanup(mother_of_all_macros()) -}}
|
Reference in New Issue
Block a user