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

[FI] Fixes and improvements for timers #2552

Merged
merged 1 commit into from
Nov 16, 2024
Merged
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
12 changes: 8 additions & 4 deletions sentences/fi/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ lists:
to: 100
timer_half:
values:
- in: "(puoli|puoleksi)"
- in: "(puoli|puoleksi|puolen|puolen tunnin|puolella tunnilla)"
out: 30
- in: "1/2"
out: 30
Expand All @@ -172,6 +172,10 @@ lists:
values:
- in: "(3 vartin|3 vartiksi|3 vartilla)"
out: "45"
timer_one_hour:
values:
- in: "(tunnin|tunti|tunniksi|tunnilla)"
out: "1"
timer_name:
wildcard: true
timer_command:
Expand Down Expand Up @@ -393,13 +397,13 @@ expansion_rules:
timer_set: "(aloita|luo|käynnistä|aseta|laita)"
timer_cancel: "(peruuta|poista|lopeta)"
timer_duration_seconds: "{timer_seconds:seconds} (sekunti[a]|sekunnilla|sekunniksi|sekunnille|sekunnin)"
timer_duration_minutes: "({timer_minutes:minutes} (minuutti[a]|minuutilla|minuutiksi|minuutille|minuutin)[ [ja ]{timer_seconds:seconds} (sekunti[a]|sekunnilla|sekunniksi|sekunnille|sekunnin)])|({timer_minutes:minutes} ja {timer_half:seconds} (minuutti[a]|minuutilla|minuutiksi|minuutille|minuutin))|({timer_half:seconds} (minuutti[a]|minuutilla|minuutiksi|minuutille|minuutin))"
timer_duration_hours: "({timer_hours:hours} (tunti[a]|tunnilla|tunniksi|tunnille|tunnin)[ [ja ]{timer_minutes:minutes} (minuutti[a]|minuutilla|minuutiksi|minuutille|minuutin)][ [ja ]{timer_seconds:seconds} (sekunti[a]|sekunnilla|sekunniksi|sekunnille|sekunnin)])|({timer_hours:hours} ja {timer_half:minutes} (tunti[a]|tunnilla|tunniksi|tunnille|tunnin))|({timer_half:minutes} (tunti[a]|tunnilla|tunniksi|tunnille|tunnin))"
timer_duration_minutes: "{timer_three_quarter:minutes}|{timer_quarter:minutes}|({timer_minutes:minutes} (minuutti[a]|minuutilla|minuutiksi|minuutille|minuutin)[ [ja ]{timer_seconds:seconds} (sekunti[a]|sekunnilla|sekunniksi|sekunnille|sekunnin)])|({timer_minutes:minutes} ja {timer_half:seconds} (minuutti[a]|minuutilla|minuutiksi|minuutille|minuutin))|({timer_half:seconds} (minuutti[a]|minuutilla|minuutiksi|minuutille|minuutin))"
timer_duration_hours: "{timer_one_hour:hours}|({timer_hours:hours} (tunti[a]|tunnilla|tunniksi|tunnille|tunnin)[ [ja ]{timer_minutes:minutes} (minuutti[a]|minuutilla|minuutiksi|minuutille|minuutin)][ [ja ]{timer_seconds:seconds} (sekunti[a]|sekunnilla|sekunniksi|sekunnille|sekunnin)])|({timer_hours:hours} ja {timer_half:minutes} (tunti[a]|tunnilla|tunniksi|tunnille|tunnin))|({timer_half:minutes} (tunti[a]|tunnilla|tunniksi|tunnille|tunnin))"
timer_duration: "<timer_duration_seconds>|<timer_duration_minutes>|<timer_duration_hours>"

timer_start_seconds: "{timer_seconds:start_seconds} (sekunti[a]|sekunnin|sekunnille)"
timer_start_minutes: "{timer_minutes:start_minutes} (minuutti[a]|minuutin|minuutille)[ [ja ]{timer_seconds:start_seconds} (sekunti[a]|sekunnin|sekunnille)]"
timer_start_hours: "{timer_hours:start_hours} (tunti[a]|tunnin|tunnille)[ [ja ]{timer_minutes:start_minutes} (minuutti[a]|minuutin|minuutille)][ [ja ]{timer_seconds:start_seconds} (sekunti[a]|sekunnin|sekunnille)]"
timer_start_hours: "{timer_three_quarter:start_minutes}|{timer_quarter:start_minutes}|{timer_one_hour:start_hours}|{timer_hours:start_hours} (tunti[a]|tunnin|tunnille)[ [ja ]{timer_minutes:start_minutes} (minuutti[a]|minuutin|minuutille)][ [ja ]{timer_seconds:start_seconds} (sekunti[a]|sekunnin|sekunnille)]"
timer_start: "<timer_start_seconds>|<timer_start_minutes>|<timer_start_hours>"

skip_words:
Expand Down
5 changes: 2 additions & 3 deletions sentences/fi/homeassistant_HassCancelTimer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ intents:
- sentences:
- "<timer_cancel> [minun|mun] (ajastin|ajastus)"
- "<timer_cancel> [minun|mun] <timer_start> (ajastin|ajastus)"
- "<timer_cancel> [minun|mun] (ajastin|ajastus) <timer_start>"
- "<timer_cancel> [minun|mun] <alueen> {area} (ajastin|ajastus)"
- "<timer_cancel> [minun|mun] (ajastin|ajastus) (<alueella>|<alueelta>|<alueesta>|<alueessa>) {area}"
- "<timer_cancel> [minun|mun] (ajastin|ajastus) [nimeltä] {timer_name:name}"
- "<timer_cancel> [minun|mun] {timer_name:name} [niminen] (ajastin|ajastus)"
- "<timer_cancel> [minun|mun] (ajastin|ajastus) nimeltä {timer_name:name}"
- "<timer_cancel> [minun|mun] {timer_name:name} niminen (ajastin|ajastus)"
20 changes: 12 additions & 8 deletions sentences/fi/homeassistant_HassStartTimer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ intents:
HassStartTimer:
data:
- sentences:
- "(ajastin|ajastus) <timer_duration>"
- "<timer_set> <timer_duration> (ajastin|ajastus) (nimellä|nimeltä|nimelle) {timer_name:name}"
- "<timer_set> (ajastin|ajastus) (nimellä|nimeltä|nimelle) {timer_name:name} ajalle <timer_duration>"
- "<timer_set> (ajastin|ajastus) <timer_duration> (nimellä|nimeltä|nimelle) {timer_name:name}"
- "<timer_set> {timer_name:name} (niminen) (ajastin|ajastus) <timer_duration>"
- "<timer_set> <timer_duration> (ajastin|ajastus) (nimeltä|nimelle|nimellä) {timer_name:name}"
- "(ajastin|ajastus) <timer_duration> (nimeltä|nimelle|nimellä) {timer_name:name}"
- "<timer_duration> (ajastin|ajastus)"
- "<timer_duration> (ajastin|ajastus) (nimeltä|nimelle|nimellä) {timer_name:name}"
- "<timer_set> <timer_duration> (ajastin|ajastus)"
- "<timer_set> (ajastin|ajastus) <timer_duration>"
- "<timer_set> <timer_duration> (ajastin|ajastus) (nimellä|nimeltä|nimelle) {timer_name:name}"
- "<timer_set> (ajastin|ajastus) (nimellä|nimeltä|nimelle) {timer_name:name} <timer_duration>"
- "<timer_set> (ajastin|ajastus) <timer_duration> (nimellä|nimeltä|nimelle) {timer_name:name}"
- "<timer_set> (ajastin|ajastus) (nimellä|nimeltä|nimelle) {timer_name:name} ajalle <timer_duration>"
- "(ajastin|ajastus) <timer_duration>"
- "<timer_duration> (ajastin|ajastus)"

#doesn't work
#- "<timer_set> (ajastin|ajastus) (nimellä|nimeltä|nimelle) {timer_name:name} <timer_duration>"

- sentences:
# The ones below won't work because it has two wildcards after each other - saved for using after a possible fix
# The ones below won't work because it has two wildcards after each other - saved for use after a possible fix
#- "{timer_command:conversation_command} <timer_duration> [kuluttua|päästä|jälkeen]"
#- "ajasta {timer_command:conversation_command} <timer_duration> [kuluttua|päästä|jälkeen]"
- "<timer_duration> (kuluttua|päästä|jälkeen) {timer_command:conversation_command}"
Expand Down
3 changes: 1 addition & 2 deletions tests/fi/homeassistant_HassCancelTimer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ tests:

- sentences:
- "peruuta 5 minuutin ajastin"
- "lopeta ajastus 5 minuutille"
- "poista 5 minuutin ajastus"
intent:
name: HassCancelTimer
Expand All @@ -20,7 +19,7 @@ tests:
response: Ajastin peruutettu

- sentences:
- "peruuta pizza ajastin"
- "peruuta pizza niminen ajastin"
- "lopeta pizza niminen ajastus"
- "poista ajastus nimeltä pizza"
intent:
Expand Down
5 changes: 2 additions & 3 deletions tests/fi/homeassistant_HassStartTimer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,8 @@ tests:

- sentences:
- "aloita 5 minuutin ajastin nimeltä pizza"
- "käynnistä 5 minuutin ajastin nimelle pizza"
- "5 minuutin ajastus nimellä pizza"
- "aseta ajastin nimeltä pizza ajalle 5 minuutiksi"
- "käynnistä 5 minuutin ajastus nimelle pizza"
- "aseta ajastin nimeltä pizza ajalle 5 minuuttia"
- "ajastin 5 minuutiksi nimelle pizza"
intent:
name: HassStartTimer
Expand Down
Loading