Debian Codegraph @

intents/responses/uk/HassStartTimer.yaml

raw symbols SCIP
1 language: uk
2 responses:
3 intents:
4 HassStartTimer:
5 default: >
6 {% set h = slots.hours if slots.hours is defined else none %}
7 {% set m = slots.minutes if slots.minutes is defined else none %}
8 {% set s = slots.seconds if slots.seconds is defined else none %}
9 {% set h_text = h ~ (' годину' if h | int % 10 == 1 and h != "11" else (' години' if h | int % 10 in [2, 3, 4] and h not in ["12", "13", "14"] else ' годин')) if h else '' %}
10 {% set m_text = (90 if m in ['півтори', '1.5'] else (30 if m in ['пів', '1/2', 'половиною'] else m)) ~
11 (' хвилину' if m | int % 10 == 1 and m != "11" else
12 (' хвилини' if m | int % 10 in [2, 3, 4] and m not in ["12", "13", "14"] else
13 ' хвилин')) if m else '' %}
14 {% set s_text = (90 if s in ['півтори', '1.5'] else (30 if s in ['пів', '1/2', 'половиною'] else s)) ~
15 (' секунду' if s | int % 10 == 1 and s != "11" else
16 (' секунди' if s | int % 10 in [2, 3, 4] and s not in ["12", "13", "14"] else
17 ' секунд')) if s else '' %}
18 {% set text_list = [ h_text, m_text, s_text] | select() | list %}
19 {% set text = text_list[:-1] | join(', ') ~ ' та ' ~ text_list[-1] if text_list | count > 2 else text_list | join(' та ') %}
20 {% set name = (' з назвою ' ~ slots.name | trim) if slots.name is defined else '' %}
21 Встановлено таймер на {{ text }}{{ name }}
22 command: >
23 {% set h = slots.hours if slots.hours is defined else none %}
24 {% set m = slots.minutes if slots.minutes is defined else none %}
25 {% set s = slots.seconds if slots.seconds is defined else none %}
26 {% set h_text = h ~ (' годину' if h | int % 10 == 1 and h != "11" else (' години' if h | int % 10 in [2, 3, 4] and h not in ["12", "13", "14"] else ' годин')) if h else '' %}
27 {% set m_text = (90 if m in ['півтори', '1.5'] else (30 if m in ['пів', '1/2', 'половиною'] else m)) ~
28 (' хвилину' if m | int % 10 == 1 and m != "11" else
29 (' хвилини' if m | int % 10 in [2, 3, 4] and m not in ["12", "13", "14"] else
30 ' хвилин')) if m else '' %}
31 {% set s_text = (90 if s in ['півтори', '1.5'] else (30 if s in ['пів', '1/2', 'половиною'] else s)) ~
32 (' секунду' if s | int % 10 == 1 and s != "11" else
33 (' секунди' if s | int % 10 in [2, 3, 4] and s not in ["12", "13", "14"] else
34 ' секунд')) if s else '' %}
35 {% set text_list = [ h_text, m_text, s_text] | select() | list %}
36 {% set text = text_list[:-1] | join(', ') ~ ' та ' ~ text_list[-1] if text_list | count > 2 else text_list | join(' та ') %}
37 Команду буде виконано через {{ text }}