Debian Codegraph @

intents/responses/th/HassTimerStatus.yaml

raw
1 language: th
2 responses:
3 intents:
4 HassTimerStatus:
5 default:
6 "TODO: {% set num_timers = slots.timers | length %}\n{% set active_timers\
7 \ = slots.timers | selectattr('is_active') | list %}\n{% set num_active_timers\
8 \ = active_timers | length %}\n{% set paused_timers = slots.timers | rejectattr('is_active')\
9 \ | list %}\n{% set num_paused_timers = paused_timers | length %}\n{% set\
10 \ next_timer = None %}\n\n{% if num_timers == 0: %}\n No timers.\n{% elif\
11 \ num_active_timers == 0: %}\n {# No active timers #}\n {% if num_paused_timers\
12 \ == 1: %}\n {% set next_timer = paused_timers[0] %}\n Timer is paused.\n\
13 \ {% else: %}\n {{ num_paused_timers }} paused timers.\n {% endif %}\n\
14 {% else: %}\n {# At least one active timer #}\n {% if num_active_timers\
15 \ == 1: %}\n {% set next_timer = active_timers[0] %}\n {% else: %}\n \
16 \ {# Get active timer that will finish soonest #}\n {% set sorted_timers\
17 \ = active_timers | sort(attribute='total_seconds_left') %}\n {% set next_timer\
18 \ = sorted_timers[0] %}\n {{ num_active_timers }} running timers.\n {%\
19 \ endif %}\n\n {% if num_paused_timers == 1: %}\n 1 paused timer.\n {%\
20 \ elif num_paused_timers > 0: %}\n {{ num_paused_timers }} paused timers.\n\
21 \ {% endif %}\n{% endif %}\n\n{% if next_timer: %}\n {# At least one active\
22 \ timer #}\n {% if (next_timer.rounded_hours_left == 1) and (next_timer.rounded_minutes_left\
23 \ > 0): %}\n 1 hour and {{ next_timer.rounded_minutes_left }} minutes\n\
24 \ {% elif (next_timer.rounded_hours_left == 1): %}\n 1 hour\n {% elif\
25 \ (next_timer.rounded_hours_left > 1) and (next_timer.rounded_minutes_left\
26 \ > 0): %}\n {{ next_timer.rounded_hours_left }} hours and {{ next_timer.rounded_minutes_left\
27 \ }} minutes\n {% elif (next_timer.rounded_hours_left > 1): %}\n {{ next_timer.rounded_hours_left\
28 \ }} hours\n {% elif (next_timer.rounded_minutes_left == 1) and (next_timer.rounded_seconds_left\
29 \ > 0): %}\n 1 minute and {{ next_timer.rounded_seconds_left }} seconds\n\
30 \ {% elif (next_timer.rounded_minutes_left == 1): %}\n 1 minute\n {%\
31 \ elif (next_timer.rounded_minutes_left > 1) and (next_timer.rounded_seconds_left\
32 \ > 0): %}\n {{ next_timer.rounded_minutes_left }} minutes and {{ next_timer.rounded_seconds_left\
33 \ }} seconds\n {% elif (next_timer.rounded_minutes_left > 1): %}\n {{\
34 \ next_timer.rounded_minutes_left }} minutes\n {% elif (next_timer.rounded_seconds_left\
35 \ == 1): %}\n 1 second\n {% elif (next_timer.rounded_seconds_left > 1):\
36 \ %}\n {{ next_timer.rounded_seconds_left }} seconds\n {% endif %}\n\n\
37 \ {% if num_timers > 1: %}\n {# Give some extra information to disambiguate\
38 \ #}\n left on\n {% if (next_timer.start_hours > 0) and (next_timer.start_minutes\
39 \ > 0): %}\n {{ next_timer.start_hours }} hour and {{ next_timer.start_minutes\
40 \ }} minute\n {% elif (next_timer.start_hours > 0): %}\n {{ next_timer.start_hours\
41 \ }} hour\n {% elif (next_timer.start_minutes > 0) and (next_timer.start_seconds\
42 \ > 0): %}\n {{ next_timer.start_minutes }} minute and {{ next_timer.start_seconds\
43 \ }} second\n {% elif (next_timer.start_minutes > 0): %}\n {{ next_timer.start_minutes\
44 \ }} minute\n {% elif (next_timer.start_seconds > 0): %}\n {{ next_timer.start_seconds\
45 \ }} second\n {% endif %}\n\n {% if next_timer.name: %}\n {{ next_timer.name\
46 \ }}\n {% elif next_timer.area: %}\n {{ next_timer.area }}\n {%\
47 \ endif %}\n\n timer.\n {% else: %}\n left.\n {% endif %}\n{% endif\
48 \ %}\n"