Breaking out the Macros into an include file.

This commit is contained in:
CCOSTAN
2017-02-15 01:43:30 +00:00
parent d57d76e065
commit 8d09b9fcb1
2 changed files with 14 additions and 14 deletions

View File

@@ -22,18 +22,5 @@
value1: >
{% set person = trigger.entity_id.split('.')[1]|replace('_', ' ')%}
{% macro greeting_sentence(person) %}
{{ [
"Welcome home " ~ person,
"Guess who is home? " ~ person +" is!",
"Attention: " ~ person + " is now in the house.",
person ~ " in da house!",
"Welcome Home " ~ person + ". We've missed you. or at least Molly did.",
"Our home is now complete, Rest your head and relax your feet! Welcome Back " ~ person,
"Life is like a song, youre back where you belong. Welcome home" ~ person,
"Hey there " ~ person,
person ~ "! You're home!"
] | random }}
{% endmacro %}
!include voice.macros
{{greeting_sentence(person)}}

13
automation/Speech/voice.macros Executable file
View File

@@ -0,0 +1,13 @@
{% macro greeting_sentence(person) %}
{{ [
"Welcome home " ~ person,
"Guess who is home? " ~ person +" is!",
"Attention: " ~ person + " is now in the house.",
person ~ " in da house!",
"Welcome Home " ~ person + ". We've missed you. or at least Molly did.",
"Our home is now complete, Rest your head and relax your feet! Welcome Back " ~ person,
"Life is like a song, you<6F>re back where you belong. Welcome home" ~ person,
"Hey there " ~ person,
person ~ "! You're home!"
] | random }}
{% endmacro %}