Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HU] Create homeassistant_HassGetCurrentTime.yaml #2339

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions responses/hu/HassCancelTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
language: hu
responses:
intents:
HassCancelTimer:
default: "Időzítő törölve"
8 changes: 8 additions & 0 deletions responses/hu/HassGetCurrentTime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: hu
responses:
intents:
HassGetCurrentTime:
default: >
{% set minute_str = '{0:02d}'.format(slots.time.minute) %}

{{ slots.time.hour }}:{{ minute_str }}
6 changes: 6 additions & 0 deletions responses/hu/HassPauseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
language: hu
responses:
intents:
HassPauseTimer:
default: "Időzítő szünetel"
7 changes: 7 additions & 0 deletions responses/hu/HassStartTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
language: hu
responses:
intents:
HassStartTimer:
default: "Időzítő fut"
command: "Vettem"
91 changes: 91 additions & 0 deletions responses/hu/HassTimerStatus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
language: hu
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: %}
Nincsenek időzítők.
{% elif num_active_timers == 0: %}
{# No active timers #}
{% if num_paused_timers == 1: %}
{% set next_timer = paused_timers[0] %}
Az időzítő szünetel.
{% else: %}
{{ num_paused_timers }} szünetelő időzítő.
{% 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 }} időzítő fut.
{% endif %}

{% if num_paused_timers == 1: %}
1 időzítő szünetel.
{% elif num_paused_timers > 0: %}
{{ num_paused_timers }} időzítő szünetel.
{% endif %}
{% endif %}

{% if next_timer: %}
{# At least one active timer #}
{% if (next_timer.rounded_hours_left == 1) and (next_timer.rounded_minutes_left > 0): %}
1 óra {{ next_timer.rounded_minutes_left }} perc
{% elif (next_timer.rounded_hours_left == 1): %}
1 óra
{% elif (next_timer.rounded_hours_left > 1) and (next_timer.rounded_minutes_left > 0): %}
{{ next_timer.rounded_hours_left }} óra {{ next_timer.rounded_minutes_left }} perc
{% elif (next_timer.rounded_hours_left > 1): %}
{{ next_timer.rounded_hours_left }} óra
{% elif (next_timer.rounded_minutes_left == 1) and (next_timer.rounded_seconds_left > 0): %}
1 perc {{ next_timer.rounded_seconds_left }} másodperc
{% elif (next_timer.rounded_minutes_left == 1): %}
1 perc
{% elif (next_timer.rounded_minutes_left > 1) and (next_timer.rounded_seconds_left > 0): %}
{{ next_timer.rounded_minutes_left }} perc {{ next_timer.rounded_seconds_left }} másodperc
{% elif (next_timer.rounded_minutes_left > 1): %}
{{ next_timer.rounded_minutes_left }} perc
{% elif (next_timer.rounded_seconds_left == 1): %}
1 másodperc
{% elif (next_timer.rounded_seconds_left > 1): %}
{{ next_timer.rounded_seconds_left }} másodperc
{% endif %}

{% if num_timers > 1: %}
{# Give some extra information to disambiguate #}
vam hátra a
{% if (next_timer.start_hours > 0) and (next_timer.start_minutes > 0): %}
{{ next_timer.start_hours }} óra {{ next_timer.start_minutes }} perces
{% elif (next_timer.start_hours > 0): %}
{{ next_timer.start_hours }} órás
{% elif (next_timer.start_minutes > 0) and (next_timer.start_seconds > 0): %}
{{ next_timer.start_minutes }} perc {{ next_timer.start_seconds }} másodperces
{% elif (next_timer.start_minutes > 0): %}
{{ next_timer.start_minutes }} perces
{% elif (next_timer.start_seconds > 0): %}
{{ next_timer.start_seconds }} másodperces
{% endif %}

{% if next_timer.name: %}
{{ next_timer.name }}
{% elif next_timer.area: %}
{{ next_timer.area }}
{% endif %}

időzítőből.
{% else: %}
van hátra.
{% endif %}
{% endif %}
6 changes: 6 additions & 0 deletions responses/hu/HassUnpauseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
language: hu
responses:
intents:
HassUnpauseTimer:
default: "Időzítő újraindult"
31 changes: 31 additions & 0 deletions sentences/hu/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,30 @@ lists:
- in: "Távol"
out: "not_home"

# timer
timer_seconds:
range:
from: 1
to: 100
timer_minutes:
range:
from: 1
to: 100
timer_hours:
range:
from: 1
to: 100
timer_half:
values:
- in: "fél"
out: 30
- in: "1/2"
out: 30
timer_name:
wildcard: true
timer_command:
wildcard: true

expansion_rules:
name: "[a |az ]{name}[<name_ragok>| <name_szavak>]"
name_ragok: "(n(a|e)k|[o|e]t|r(a|e)|[o|e|ö]n)"
Expand Down Expand Up @@ -648,6 +672,13 @@ expansion_rules:
#kérédések
what_is_the_class_of_name: "(<what_is> <class> [amit] <name>[a|e|n(a|e)k] [szenzor[a|nak|on]|érzékelő[je|nek|n]|eszköz[e|nek|ön]|esemény[nek]] [mér[t]|mutat[ott]] [<area>]|<what_is> (<name> [szenzor[a|on]|érzékelő[je|n]|eszköz[ön]] [által] [mért|mutatott] <class> [értéke]; [<area>]))"

# időzítő
timer_duration_seconds: "{timer_seconds:seconds} másodperc[re|et]"
timer_duration_minutes: "{timer_minutes:minutes} perc[re|et][ [és ]{timer_seconds:seconds} másodperc[re|et]]"
timer_duration_hours: "{timer_hours:hours} órá[t|ra][ [és ]{timer_minutes:minutes} perc[re|et]][ [és ]{timer_seconds:seconds} másodperc[re|et]]"
timer_duration: "<timer_duration_seconds>|<timer_duration_minutes>|<timer_duration_hours>"
timer_cancel: "[állítsd le|töröld]"

skip_words:
- "kérem [szépen]"
- "kérlek [szépen]"
Expand Down
10 changes: 10 additions & 0 deletions sentences/hu/homeassistant_HassCancelTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
language: "hu"
intents:
HassCancelTimer:
data:
- sentences:
- "<timer_cancel> az időzítőt"
- "<timer_cancel> a visszaszámlálást"
- "<timer_cancel> a[z] {timer_name:name} [nevű ]visszaszámlálás[t]"
- "<timer_cancel> a[z] {timer_name:name} [nevű ]időzítő[t]"
7 changes: 7 additions & 0 deletions sentences/hu/homeassistant_HassGetCurrentTime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: hu
intents:
HassGetCurrentTime:
data:
- sentences:
- "mennyi[ most] a pontos idő"
- "mennyi[ most] az idő"
10 changes: 10 additions & 0 deletions sentences/hu/homeassistant_HassPauseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
language: "hu"
intents:
HassPauseTimer:
data:
- sentences:
- "szüneteljen a visszaszámlálás"
- "szüneteltesd a visszaszámlálást"
- "szüneteljen a[z] {timer_name:name}[ nevű] visszaszámlálás"
- "szüneteltesd a[z] {timer_name:name}[ nevű] visszaszámlálást"
11 changes: 11 additions & 0 deletions sentences/hu/homeassistant_HassStartTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
language: "hu"
intents:
HassStartTimer:
data:
- sentences:
- "állíts [be ][egy ] időzítőt <timer_duration>"
- "állíts [be ][egy ] {timer_name:name} időzítőt <timer_duration>"
- "számolj vissza <timer_duration>"
- "értesíts <timer_duration> múlva"
response: command
8 changes: 8 additions & 0 deletions sentences/hu/homeassistant_HassTimerStatus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
language: "hu"
intents:
HassTimerStatus:
data:
- sentences:
- "időzítő(k) állapota"
- "mennyi idő van még[ hátra| vissza]"
8 changes: 8 additions & 0 deletions sentences/hu/homeassistant_HassUnpauseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
language: "hu"
intents:
HassUnpauseTimer:
data:
- sentences:
- "folytasd a visszaszámlálást"
- "folytasd[ a| az] {timer_name:name}[ nevű][ időzítőt| visszaszámlálást]"
20 changes: 20 additions & 0 deletions tests/hu/_fixtures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -716,3 +716,23 @@ entities:
- name: "consuela"
id: "vacuum.consuela"
state: "idle"

timers:
- is_active: false
start_hours: 1
total_seconds_left: 100
rounded_hours_left: 0
rounded_minutes_left: 1
rounded_seconds_left: 40
- name: "főtt tojás"
start_minutes: 30
total_seconds_left: 1505
rounded_hours_left: 0
rounded_minutes_left: 25
rounded_seconds_left: 0
- area: "ebédlő"
start_minutes: 5
total_seconds_left: 190
rounded_hours_left: 0
rounded_minutes_left: 3
rounded_seconds_left: 0
18 changes: 18 additions & 0 deletions tests/hu/homeassistant_HassCancelTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: hu
tests:
- sentences:
- "állítsd le az időzítőt"
- "állítsd le a visszaszámlálást"
- "töröld az időzítőt"
- "töröld a visszaszámlálást"
intent:
name: HassCancelTimer
response: Időzítő törölve
- sentences:
- "állítsd le a főtt tojás nevű visszaszámlálást"
- "töröld a főtt tojás nevű időzítőt"
intent:
name: HassCancelTimer
slots:
name: főtt tojás
response: Időzítő törölve
9 changes: 9 additions & 0 deletions tests/hu/homeassistant_HassGetCurrentTime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: hu
tests:
- sentences:
- "mennyi az idő"
- "mennyi most az idő"
- "mennyi a pontos idő"
intent:
name: HassGetCurrentTime
response: "1:02"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a dynamic response for the current time.

The response is currently a static time ("1:02"). For better accuracy, consider using a dynamic response that reflects the actual current time.

response: "{{ now().strftime('%H:%M') }}"

16 changes: 16 additions & 0 deletions tests/hu/homeassistant_HassPauseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: hu
tests:
- sentences:
- "szüneteljen a visszaszámlálás"
- "szüneteltesd a visszaszámlálást"
intent:
name: HassPauseTimer
response: Időzítő szünetel
- sentences:
- "szüneteltesd a főtt tojás visszaszámlálást"
- "szüneteljen a főtt tojás nevű visszaszámlálás"
intent:
name: HassPauseTimer
slots:
name: főtt tojás
response: Időzítő szünetel
23 changes: 23 additions & 0 deletions tests/hu/homeassistant_HassStartTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
language: hu
tests:
- sentences:
- "állíts időzítőt 2 percre"
- "állíts be időzítőt 2 percre"
- "állíts egy időzítőt 2 percre"
- "állíts be egy időzítőt 2 percre"
- "számolj vissza 2 percet"
- "számolj vissza 30 másodpercet"
- "értesíts 2 perc múlva"
intent:
name: HassStartTimer
slots:
minutes: 2
response: Vettem
- sentences:
- "állíts egy főtt tojás időzítőt 2 percre"
intent:
name: HassStartTimer
slots:
minutes: 2
name: főtt tojás
response: Vettem
11 changes: 11 additions & 0 deletions tests/hu/homeassistant_HassTimerStatus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: hu
tests:
- sentences:
- "időzítők állapota"
- "időzítő állapota"
- "mennyi idő van még vissza"
- "mennyi idő van még hátra"
intent:
name: HassTimerStatus
response: |
2 időzítő fut. 1 időzítő szünetel. 3 perc van hátra az 5 perces ebédlő időzítőből.
15 changes: 15 additions & 0 deletions tests/hu/homeassistant_HassUnpauseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
language: hu
tests:
- sentences:
- "folytasd a visszaszámlálást"
intent:
name: HassUnpauseTimer
response: Időzítő újraindult
- sentences:
- "folytasd a főtt tojás nevű visszaszámlálást"
- "folytasd a főtt tojás nevű időzítőt"
intent:
name: HassUnpauseTimer
slots:
name: főtt tojás
response: Időzítő újraindult