From ae5c2e49b0f03081bffbfb793683278e85fb99d9 Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Wed, 15 Feb 2017 01:51:58 +0000 Subject: [PATCH] Moving all speech into an include file --- automation/Speech/voice.macros | 10 ++++++++++ automation/sunrise_turnon_and_off.yaml | 8 ++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/automation/Speech/voice.macros b/automation/Speech/voice.macros index 572b6bbf..ceb352aa 100755 --- a/automation/Speech/voice.macros +++ b/automation/Speech/voice.macros @@ -10,4 +10,14 @@ "Hey there " ~ person, person ~ "! You're home!" ] | random }} + {% endmacro %} + + + {% macro dark_outside() %} + {{ [ + "It is pretty dark outside. I will turn on the outside lights now.", + "It's a little past Sunset. Time to turn on the outside lights. I'm on it.", + "I'll switch on the outside lights. It's getting dark outside.", + "Time to turn on the front lights. I'll take care of it." + ] | random }} {% endmacro %} \ No newline at end of file diff --git a/automation/sunrise_turnon_and_off.yaml b/automation/sunrise_turnon_and_off.yaml index 6038e0ac..c42cc0be 100755 --- a/automation/sunrise_turnon_and_off.yaml +++ b/automation/sunrise_turnon_and_off.yaml @@ -25,12 +25,8 @@ - service: script.Voice_notify data_template: value1: > - {{ [ - "It is pretty dark outside. I will turn on the outside lights now.", - "It's a little past Sunset. Time to turn on the outside lights. I'm on it.", - "I'll switch on the outside lights. It's getting dark outside.", - "Time to turn on the front lights. I'll take care of it." - ] | random }} + !include voice.macros + {{ dark_outside() }} ###################################################################### - alias: 'Sunset Stuff off'