From 8d09b9fcb1ea058c27395a658c780d59bf30cc14 Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Wed, 15 Feb 2017 01:43:30 +0000 Subject: [PATCH] Breaking out the Macros into an include file. --- automation/Speech/announcements.yaml | 15 +-------------- automation/Speech/voice.macros | 13 +++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) create mode 100755 automation/Speech/voice.macros diff --git a/automation/Speech/announcements.yaml b/automation/Speech/announcements.yaml index dc91a1b7..0e35dbef 100755 --- a/automation/Speech/announcements.yaml +++ b/automation/Speech/announcements.yaml @@ -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, you’re back where you belong. Welcome home" ~ person, - "Hey there " ~ person, - person ~ "! You're home!" - ] | random }} - {% endmacro %} + !include voice.macros {{greeting_sentence(person)}} \ No newline at end of file diff --git a/automation/Speech/voice.macros b/automation/Speech/voice.macros new file mode 100755 index 00000000..572b6bbf --- /dev/null +++ b/automation/Speech/voice.macros @@ -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’re back where you belong. Welcome home" ~ person, + "Hey there " ~ person, + person ~ "! You're home!" + ] | random }} + {% endmacro %} \ No newline at end of file