language: ne responses: intents: HassTimerStatus: default: | {% set num_timers = slots.timers | length %} {% set active_timers = slots.timers | selectattr('is_active') | list %} {% set num_active_timers = active_timers | length %} {% set paused_timers = slots.timers | rejectattr('is_active') | list %} {% set num_paused_timers = paused_timers | length %} {% set next_timer = None %} {% if num_timers == 0 %} कुनै टाइमरहरू छैन। {% elif num_active_timers == 0 %} {# No active timers #} {% if num_paused_timers == 1 %} {% set next_timer = paused_timers[0] %} टाइमर रोकिएको छ। {% else %} {{ num_paused_timers }} ओटा टाइमरहरू रोकिएका छन्। {% endif %} {% else %} {# At least one active timer #} {% if num_active_timers == 1 %} {% set next_timer = active_timers[0] %} {% else %} {# Get active timer that will finish soonest #} {% set sorted_timers = active_timers | sort(attribute='total_seconds_left') %} {% set next_timer = sorted_timers[0] %} {{ num_active_timers }} ओटा टाइमरहरू चलिरहेका छन्। {% endif %} {% if num_paused_timers == 1 %} एउटा टाइमर रोकिएको छ। {% elif num_paused_timers > 0 %} {{ num_paused_timers }} ओटा टाइमरहरू रोकिएका छन्। {% endif %} {% endif %} {% if next_timer %} {# Create the string for the time left #} {% set time_left_str %} {%- if (next_timer.rounded_hours_left > 0) and (next_timer.rounded_minutes_left > 0) -%} {{ next_timer.rounded_hours_left }} घण्टा र {{ next_timer.rounded_minutes_left }} मिनेट {%- elif (next_timer.rounded_hours_left > 0) -%} {{ next_timer.rounded_hours_left }} घण्टा {%- elif (next_timer.rounded_minutes_left > 0) and (next_timer.rounded_seconds_left > 0) -%} {{ next_timer.rounded_minutes_left }} मिनेट र {{ next_timer.rounded_seconds_left }} सेकेन्ड {%- elif (next_timer.rounded_minutes_left > 0) -%} {{ next_timer.rounded_minutes_left }} मिनेट {%- elif (next_timer.rounded_seconds_left > 0) -%} {{ next_timer.rounded_seconds_left }} सेकेन्ड {%- endif -%} {% endset %} {# Check if we need to specify which timer we are talking about #} {% if num_timers > 1 and next_timer.is_active %} {# Create the string that identifies the timer, e.g., "Kitchen's 5 minute" #} {% set timer_id_str %} {%- if next_timer.name -%} {{ next_timer.name }}को {%- elif next_timer.area -%} {{ next_timer.area }}को {%- endif -%} {%- if (next_timer.start_hours > 0) and (next_timer.start_minutes > 0) -%} {{ " " }}{{ next_timer.start_hours }} घण्टा र {{ next_timer.start_minutes }} मिनेटको {%- elif (next_timer.start_hours > 0) -%} {{ " " }}{{ next_timer.start_hours }} घण्टाको {%- elif (next_timer.start_minutes > 0) and (next_timer.start_seconds > 0) -%} {{ " " }}{{ next_timer.start_minutes }} मिनेट र {{ next_timer.start_seconds }} सेकेन्डको {%- elif (next_timer.start_minutes > 0) -%} {{ " " }}{{ next_timer.start_minutes }} मिनेटको {%- elif (next_timer.start_seconds > 0) -%} {{ " " }}{{ next_timer.start_seconds }} सेकेन्डको {%- endif -%} {% endset %} {# Combine for the final sentence #} {{- timer_id_str | trim }} टाइमरमा {{ time_left_str }} बाँकी छ। {% elif time_left_str | trim | length > 0 %} {# Simple response for a single timer #} {{ time_left_str }} बाँकी छ। {% endif %} {% endif %}