Debian Codegraph @

intents/responses/ru/HassTimerStatus.yaml

raw symbols SCIP
1 ---
2 language: ru
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 Таймеры отсутствуют.
16 {% elif num_active_timers == 0: %}
17 {# No active timers #}
18 {% if num_paused_timers == 1: %}
19 {% set next_timer = paused_timers[0] %}
20 Таймер приостановлен.
21 {% else: %}
22 {{ num_paused_timers }} приостановленных таймера.
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 }} запущенных таймера.
33 {% endif %}
34
35 {% if num_paused_timers == 1: %}
36 1 приостановленный таймер.
37 {% elif num_paused_timers > 0: %}
38 {{ num_paused_timers }} приостановленных таймера.
39 {% endif %}
40 {% endif %}
41
42 {% if next_timer: %}
43 {# At least one active timer #}
44 {% if (next_timer.rounded_hours_left == 1) and (next_timer.rounded_minutes_left > 0): %}
45 1 час и {{ next_timer.rounded_minutes_left }} минут
46 {% elif (next_timer.rounded_hours_left == 1): %}
47 1 час
48 {% elif (next_timer.rounded_hours_left > 1) and (next_timer.rounded_minutes_left > 0): %}
49 {{ next_timer.rounded_hours_left }} часов и {{ next_timer.rounded_minutes_left }} минут
50 {% elif (next_timer.rounded_hours_left > 1): %}
51 {{ next_timer.rounded_hours_left }} часов
52 {% elif (next_timer.rounded_minutes_left == 1) and (next_timer.rounded_seconds_left > 0): %}
53 1 минута и {{ next_timer.rounded_seconds_left }} секунд
54 {% elif (next_timer.rounded_minutes_left == 1): %}
55 1 минута
56 {% elif (next_timer.rounded_minutes_left > 1) and (next_timer.rounded_seconds_left > 0): %}
57 {{ next_timer.rounded_minutes_left }} минут и {{ next_timer.rounded_seconds_left }} секунд
58 {% elif (next_timer.rounded_minutes_left > 1): %}
59 {{ next_timer.rounded_minutes_left }} минут
60 {% elif (next_timer.rounded_seconds_left == 1): %}
61 1 секунда
62 {% elif (next_timer.rounded_seconds_left > 1): %}
63 {{ next_timer.rounded_seconds_left }} секунд
64 {% endif %}
65
66 {% if num_timers > 1: %}
67 {# Give some extra information to disambiguate #}
68 осталось на таймере
69 {% if (next_timer.start_hours > 0) and (next_timer.start_minutes > 0): %}
70 {{ next_timer.start_hours }} час и {{ next_timer.start_minutes }} минут
71 {% elif (next_timer.start_hours > 0): %}
72 {{ next_timer.start_hours }} час
73 {% elif (next_timer.start_minutes > 0) and (next_timer.start_seconds > 0): %}
74 {{ next_timer.start_minutes }} минут и {{ next_timer.start_seconds }} секунд
75 {% elif (next_timer.start_minutes > 0): %}
76 {{ next_timer.start_minutes }} минут
77 {% elif (next_timer.start_seconds > 0): %}
78 {{ next_timer.start_seconds }} секунд
79 {% endif %}
80
81 {% if next_timer.name: %}
82 {{ next_timer.name }}
83 {% elif next_timer.area: %}
84 {{ next_timer.area }}
85 {% endif %}
86 {% else: %}
87 осталось.
88 {% endif %}
89 {% endif %}