Debian Codegraph @

intents/responses/pl/HassTimerStatus.yaml

raw
1 language: pl
2 responses:
3 intents:
4 HassTimerStatus:
5 default: |
6 {% set num_timers = slots.timers | length %}
7 {% set active_timers = slots.timers | selectattr('is_active') | list %}
8 {% set num_active_timers = active_timers | length %}
9 {% set paused_timers = slots.timers | rejectattr('is_active') | list %}
10 {% set num_paused_timers = paused_timers | length %}
11 {% set next_timer = None %}
12
13 {% if num_timers == 0: %}
14 Brak uruchomionych minutników.
15 {% elif num_active_timers == 0: %}
16 {# No active timers #}
17 {% if num_paused_timers == 1: %}
18 {% set next_timer = paused_timers[0] %}
19 Minutnik jest wstrzymany.
20 {% else: %}
21 {# 2,3,4 wstrzymane minutniki #}
22 {# 5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21 wstrzymanych minutników #}
23 {# 22,23,24 wstrzymane minutniki #}
24 {% if (num_paused_timers|string)[-1] in ["2", "3", "4"]: %}
25 {{ num_paused_timers }} wstrzymane minutniki.
26 {% else: %}
27 {{ num_paused_timers }} wstrzymanych minutników.
28 {% endif %}
29 {% endif %}
30 {% else: %}
31 {# At least one active timer #}
32 {% if num_active_timers == 1: %}
33 {% set next_timer = active_timers[0] %}
34 {% else: %}
35 {# Get active timer that will finish soonest #}
36 {% set sorted_timers = active_timers | sort(attribute='total_seconds_left') %}
37 {% set next_timer = sorted_timers[0] %}
38 {# 2,3,4 uruchomione minutniki #}
39 {# 5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21 uruchomionych minutników #}
40 {# 22,23,24 wstrzymane minutniki #}
41 {% if (num_active_timers|string)[-1] in ["2", "3", "4"]: %}
42 {{ num_active_timers }} uruchomione minutniki.
43 {% else: %}
44 {{ num_active_timers }} uruchomionych minutników.
45 {% endif %}
46 {% endif %}
47
48 {% if num_paused_timers == 1: %}
49 1 wstrzymany minutnik.
50 {% elif num_paused_timers > 0: %}
51 {# 2,3,4 wstrzymane minutniki #}
52 {# 5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21 wstrzymanych minutników #}
53 {# 22,23,24 wstrzymane minutniki #}
54 {% if (num_paused_timers|string)[-1] in ["2", "3", "4"]: %}
55 {{ num_paused_timers }} wstrzymane minutniki.
56 {% else: %}
57 {{ num_paused_timers }} wstrzymanych minutników.
58 {% endif %}
59 {% endif %}
60 {% endif %}
61
62 {% if next_timer: %}
63 {# At least one active timer #}
64 {% if (next_timer.rounded_hours_left == 1) and (next_timer.rounded_minutes_left > 0): %}
65 Pozostała jedna godzina i {{ next_timer.rounded_minutes_left }} {% if next_timer.rounded_minutes_left == 1: %}minuta{% elif (next_timer.rounded_minutes_left|string)[-1] in ["2", "3", "4"]: %}minuty{% else: %}minut{% endif %}
66 {% elif (next_timer.rounded_hours_left == 1): %}
67 Pozostała jedna godzina
68 {% elif (next_timer.rounded_hours_left > 1) and (next_timer.rounded_minutes_left > 0): %}
69 {# 2,3,4 godziny #}
70 {# 5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21 godzin #}
71 {# 22,23,24 godziny #}}
72 {# 1 minuta #}
73 {# 2,3,4 minuty #}
74 {# 5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21 minut #}
75 {# 22,23,24 minuty #}
76 {# 25,26,27,28,29,30,31 minut #}
77 {# pozostała 1 #}
78 {# pozostały 2, 3, 4 #}
79 {# pozostało 5, 6 ... #}
80 {% if next_timer.rounded_hours_left == 1: %}Pozostała{% elif (next_timer.rounded_hours_left|string)[-1] in ["2", "3", "4"]: %}Pozostały{% else: %}Pozostało{% endif %}
81 {{ next_timer.rounded_hours_left }} {% if (next_timer.rounded_hours_left|string)[-1] in ["2", "3", "4"]: %}godziny{% else: %}godzin{% endif %} i
82 {{ next_timer.rounded_minutes_left }} {% if next_timer.rounded_minutes_left == 1: %}minuta{% elif (next_timer.rounded_minutes_left|string)[-1] in ["2", "3", "4"]: %}minuty{% else: %}minut{% endif %}
83 {% elif (next_timer.rounded_hours_left > 1): %}
84 {% if next_timer.rounded_hours_left == 1: %}Pozostała{% elif (next_timer.rounded_hours_left|string)[-1] in ["2", "3", "4"]: %}Pozostały{% else: %}Pozostało{% endif %}
85 {{ next_timer.rounded_hours_left }} {% if (next_timer.rounded_hours_left|string)[-1] in ["2", "3", "4"]: %}godziny{% else: %}godzin{% endif %}
86 {% elif (next_timer.rounded_minutes_left == 1) and (next_timer.rounded_seconds_left > 0): %}
87 Pozostała jedna minuta i {{ next_timer.rounded_seconds_left }} {% if next_timer.rounded_seconds_left == 1: %}sekunda{% elif (next_timer.rounded_seconds_left|string)[-1] in ["2", "3", "4"]: %}sekundy{% else: %}sekund{% endif %}
88 {% elif (next_timer.rounded_minutes_left == 1): %}
89 Pozostała jedna minuta
90 {% elif (next_timer.rounded_minutes_left > 1) and (next_timer.rounded_seconds_left > 0): %}
91 {% if next_timer.rounded_minutes_left == 1: %}Pozostała{% elif (next_timer.rounded_minutes_left|string)[-1] in ["2", "3", "4"]: %}Pozostały{% else: %}Pozostało{% endif %} {{ next_timer.rounded_minutes_left }} {% if (next_timer.rounded_minutes_left|string)[-1] in ["2", "3", "4"]: %}minuty{% else: %}minut{% endif %} i {{ next_timer.rounded_seconds_left }} {% if next_timer.rounded_seconds_left == 1: %}sekunda{% elif (next_timer.rounded_seconds_left|string)[-1] in ["2", "3", "4"]: %}sekundy{% else: %}sekund{% endif %}
92 {% elif (next_timer.rounded_minutes_left > 1): %}
93 {% if next_timer.rounded_minutes_left == 1: %}Pozostała{% elif (next_timer.rounded_minutes_left|string)[-1] in ["2", "3", "4"]: %}Pozostały{% else: %}Pozostało{% endif %} {{ next_timer.rounded_minutes_left }} {% if next_timer.rounded_minutes_left == 1: %}minuta{% elif (next_timer.rounded_minutes_left|string)[-1] in ["2", "3", "4"]: %}minuty{% else: %}minut{% endif %}
94 {% elif (next_timer.rounded_seconds_left == 1): %}
95 Pozostała jedna sekunda
96 {% elif (next_timer.rounded_seconds_left > 1): %}
97 {% if next_timer.rounded_seconds_left == 1: %}Pozostała{% elif (next_timer.rounded_seconds_left|string)[-1] in ["2", "3", "4"]: %}Pozostały{% else: %}Pozostało{% endif %} {{ next_timer.rounded_seconds_left }} {% if (next_timer.rounded_seconds_left|string)[-1] in ["2", "3", "4"]: %}sekundy{% else: %}sekund{% endif %}
98 {% endif %}
99
100 {% if num_timers > 1: %}
101 {# Give some extra information to disambiguate #}
102
103 {% if (next_timer.start_hours > 0) and (next_timer.start_minutes > 0): %}
104 na {{ next_timer.start_hours }} godzinnym i {{ next_timer.start_minutes }} minutowym minutniku
105 {% elif (next_timer.start_hours > 0): %}
106 na {{ next_timer.start_hours }} godzinnym minutniku
107 {% elif (next_timer.start_minutes > 0) and (next_timer.start_seconds > 0): %}
108 na {{ next_timer.start_minutes }} minutowym i {{ next_timer.start_seconds }} sekundowym minutniku
109 {% elif (next_timer.start_minutes > 0): %}
110 na {{ next_timer.start_minutes }} minutowym minutniku
111 {% elif (next_timer.start_seconds > 0): %}
112 na {{ next_timer.start_seconds }} sekundowym minutniku
113 {% endif %}
114
115 {% if next_timer.name: %}
116 na minutniku {{ next_timer.name }}.
117 {% elif next_timer.area: %}
118 w {{ next_timer.area }}.
119 {% endif %}
120
121 {% else: %}
122 do zakończenia.
123 {% endif %}
124 {% endif %}