Debian Codegraph @

intents/responses/fr/HassTimerStatus.yaml

raw symbols SCIP
1 ---
2 language: fr
3 responses:
4 intents:
5 HassTimerStatus:
6 default: |
7 {% set num_timers = slots.timers | length %}
8 {% set active_timers = slots.timers | selectattr('is_active') | list %}
9 {% set num_active_timers = active_timers | length %}
10 {% set paused_timers = slots.timers | rejectattr('is_active') | list %}
11 {% set num_paused_timers = paused_timers | length %}
12 {% set next_timer = None %}
13
14 {% if num_timers == 0: %}
15 Il n'y a aucun minuteur.
16 {% elif num_active_timers == 0: %}
17 {# No active timers #}
18 {% if num_paused_timers == 1: %}
19 {% set next_timer = paused_timers[0] %}
20 Le minuteur est en pause.
21 {% else: %}
22 {{ num_paused_timers }} minuteurs sont en pause.
23 {% endif %}
24 {% else: %}
25 {# At least one active timer #}
26 {% if num_active_timers == 1: %}
27 {% set next_timer = active_timers[0] %}
28 {% else: %}
29 {# Get active timer that will finish soonest #}
30 {% set sorted_timers = active_timers | sort(attribute='total_seconds_left') %}
31 {% set next_timer = sorted_timers[0] %}
32 {{ num_active_timers }} minuteurs sont actifs.
33 {% endif %}
34
35 {% if num_paused_timers == 1: %}
36 1 minuteur est en pause.
37 {% elif num_paused_timers > 0: %}
38 {{ num_paused_timers }} minuteurs sont en pause.
39 {% endif %}
40 {% endif %}
41
42 {% if next_timer: %}
43 {# At least one active timer #}
44 {% set plural = True %}
45 {% if (next_timer.rounded_hours_left == 1) and (next_timer.rounded_minutes_left > 0): %}
46 1 heure et {{ next_timer.rounded_minutes_left }} minutes
47 {% elif (next_timer.rounded_hours_left == 1): %}
48 1 heure
49 {% set plural = False %}
50 {% elif (next_timer.rounded_hours_left > 1) and (next_timer.rounded_minutes_left > 0): %}
51 {{ next_timer.rounded_hours_left }} heures et {{ next_timer.rounded_minutes_left }} minutes
52 {% elif (next_timer.rounded_hours_left > 1): %}
53 {{ next_timer.rounded_hours_left }} heures
54 {% elif (next_timer.rounded_minutes_left == 1) and (next_timer.rounded_seconds_left > 0): %}
55 1 minute et {{ next_timer.rounded_seconds_left }} secondes
56 {% elif (next_timer.rounded_minutes_left == 1): %}
57 1 minute
58 {% set plural = False %}
59 {% elif (next_timer.rounded_minutes_left > 1) and (next_timer.rounded_seconds_left > 0): %}
60 {{ next_timer.rounded_minutes_left }} minutes et {{ next_timer.rounded_seconds_left }} secondes
61 {% elif (next_timer.rounded_minutes_left > 1): %}
62 {{ next_timer.rounded_minutes_left }} minutes
63 {% elif (next_timer.rounded_seconds_left == 1): %}
64 1 seconde
65 {% set plural = False %}
66 {% elif (next_timer.rounded_seconds_left > 1): %}
67 {{ next_timer.rounded_seconds_left }} secondes
68 {% endif %}
69
70 {% if num_timers > 1: %}
71 {# Give some extra information to disambiguate #}
72 {% if plural %}restantes{% else %}restante{% endif %} sur le minuteur
73 {% if (next_timer.start_hours > 0) and (next_timer.start_minutes > 0): %}
74 de {{ next_timer.start_hours }} heures et {{ next_timer.start_minutes }} minutes
75 {% elif (next_timer.start_hours > 0): %}
76 de {{ next_timer.start_hours }} heures
77 {% elif (next_timer.start_minutes > 0) and (next_timer.start_seconds > 0): %}
78 de {{ next_timer.start_minutes }} minutes et {{ next_timer.start_seconds }} secondes
79 {% elif (next_timer.start_minutes > 0): %}
80 de {{ next_timer.start_minutes }} minutes
81 {% elif (next_timer.start_seconds > 0): %}
82 de {{ next_timer.start_seconds }} secondes
83 {% endif %}
84
85 {% if next_timer.name: %}
86 appelé {{ next_timer.name }}
87 {% elif next_timer.area: %}
88 dans {{ next_timer.area }}
89 {% endif %}
90 {% else: %}
91 {% if plural %}restantes{% else %}restante{% endif %}.
92 {% endif %}
93 {% endif %}