]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Exported audio to google and randomized laura voice
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Mon, 16 Mar 2020 15:30:12 +0000 (16:30 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Mon, 16 Mar 2020 15:30:12 +0000 (16:30 +0100)
components/google_assistant/audio.yaml [new file with mode: 0644]
script/audio.yaml

diff --git a/components/google_assistant/audio.yaml b/components/google_assistant/audio.yaml
new file mode 100644 (file)
index 0000000..932ce80
--- /dev/null
@@ -0,0 +1,8 @@
+######################################################################\r
+# Google Assistant: Audio\r
+######################################################################\r
+\r
+script.laura_voice:\r
+  name: Voce Laura\r
+  expose: true\r
+  room: Generale\r
index b08fdc9d08634bc02832590bc45597be11fa5dd0..bf6c1a5e0cc4b9d5d2c680e5abbdc70bc991aa66 100644 (file)
@@ -39,8 +39,11 @@ laura_voice:
           {{ media_player }}
         media_content_type: 'audio/mp4'
         media_content_id: >-
+          {%- macro set_type() -%}
+            {{ range(1,5,1) | random }}
+          {%- endmacro -%}
           {% if type is not defined %}
-            {% set type = 1 %}
+            {% set type = set_type() %}
           {% endif %}
           https://home.giorgioravera.it/local/audio/laura/{{type}}.mp3