]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Minor changes to speech_message.yaml
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Thu, 20 Aug 2020 13:32:37 +0000 (15:32 +0200)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Thu, 20 Aug 2020 13:32:37 +0000 (15:32 +0200)
templates/speech_message.yaml

index 00fa3f3da5896d9e8b01a7e096e7d0edd0e21e40..46ee7b8809d435db7a06187004e3ed68d17386ab 100644 (file)
   "Il consumo istantaneo è pari a {{ states.sensor.potenza_istantanea.state }} watt"\r
   {%- endmacro -%}\r
   \r
+  {# Location Status #}\r
+  {%- macro status_location(start, num) -%}\r
+    {% for entity_id in states.group.people.attributes.entity_id %}\r
+      {% set name = state_attr(entity_id, 'friendly_name') %}\r
+      {% if is_state(entity_id, 'not_home') %}\r
+        {% set position = state_attr(entity_id, 'address') %}\r
+      {% else %}\r
+        {% set position = states(entity_id) %}\r
+      {% endif %}\r
+      \r
+      {% if (loop.index >= start|int) and (loop.index < num|int+start|int) %}\r
+        La posizione di {{ name }} è {{ position }}.\r
+      {% endif %}              \r
+    {%- endfor %}\r
+  {%- endmacro -%}\r
+  \r
   {# Car Status #}\r
   {%- macro status_car() -%}\r
     {% if is_state('device_tracker.wdd1760081v167576', state_attr('zone.home', 'friendly_name')) %}\r
     {% endif %}\r
   {%- endmacro -%}\r
   \r
-  {# Location Status #}\r
-  {%- macro status_location(start, num) -%}\r
-    {% for entity_id in states.group.people.attributes.entity_id %}\r
-      {% set name = state_attr(entity_id, 'friendly_name') %}\r
-      {% if is_state(entity_id, 'not_home') %}\r
-        {% set position = state_attr(entity_id, 'address') %}\r
-      {% else %}\r
-        {% set position = states(entity_id) %}\r
-      {% endif %}\r
-      \r
-      {% if (loop.index >= start|int) and (loop.index < num|int+start|int) %}\r
-        La posizione di {{ name }} è {{ position }}.\r
-      {% endif %}              \r
-    {%- endfor %}\r
-  {%- endmacro -%}\r
-  \r
   {# End Message #}\r
   {%- macro end_message() -%}\r
     {% if enable_status | int == 1 %}\r
                     \r
   {% endif %}\r
   \r
-  {# Location Info #}\r
+  {# Location Status #}\r
   {% if (enable_status | int == 1) or (enable_location | int == 1) %}\r
     {{ status_location(location_people_start, location_people_num) }}\r
   {% endif %}\r