Skip to content

Commit

Permalink
[SL] fixed sentences and test after upgrade to hassil 2.0 #2507 (#2539)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejs2 authored Nov 15, 2024
1 parent 15c819d commit eb08a2e
Show file tree
Hide file tree
Showing 19 changed files with 249 additions and 197 deletions.
1 change: 1 addition & 0 deletions responses/sl/HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ responses:
cover_single: "Zapiram {{ slots.name }}"
cover: "Zapiram"
fans_area: "Ventilator je izklopljen"
fan_all: "Vsi ventilatorji izklopljeni"
lock: "Odklenjeno"
scene: "Deaktivirana"
valve: "Zaprt"
3 changes: 2 additions & 1 deletion responses/sl/HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ responses:
lights_floor: "Vklopljeno"
fans_area: "Ventilator je vklopljen"
cover_device_class: "Odpiram {{ slots.device_class }}"
cover_single: "Odpiram {{ slots.name }}"
#cover_single: "Odpiram {{ slots.name }}"
cover: "Odprto"
lock: "Zaklenjeno"
scene: "Aktivirana"
script: "Zagnana"
Expand Down
13 changes: 6 additions & 7 deletions sentences/sl/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ lists:
out: blinds
- in: zapah[i|e]|pokrov|polk(en|na|no|ni)
out: shutter
- in: ([strešno] ok(en|no|na|ni))
- in: ([strešn(a|o|i)] ok(en|no|na|ni))
out: window
lock_states:
values:
Expand Down Expand Up @@ -377,9 +377,10 @@ expansion_rules:
set: "(nastavi|spremeni|prilagodi|segrej|ohladi|dvigni|znižaj|spusti|dodaj|daj|obrni|odpri|zasuči|zavrti|odvij|zapri|odgrni|zagrni)"
zapri: "(zapri|spusti|zagrni|zatesni|z[a]vij)"
odpri: "(odpri|dvigni|odgrni|razkrij|razvij|odkrij)"
covers: "([balkonska|zadnja|sprednja|drsna|kuhinjska]) vrata| ok(no|ni|na|en)| rolet(a|o|i|e) | žaluzij[a|o|i|e] | markiz(a|i|e|o) | tend(a|i|e|o) | (pokrov|pokrivalo) bazena | ograj(a|i|e|o) | zaves(a|o|i|e)"
covers: "(vrata| ok(no|ni|na|en))| rolet(a|o|i|e) | žaluzij[a|o|i|e] | markiz(a|i|e|o) | tend(a|i|e|o) | (pokrov|pokrivalo) bazena | ograj(a|i|e|o) | zaves(a|o|i|e)"
ventilator: "ventila(tor|torja|torje|cijo|cije|cij)|prezračevanje|nap(a|o|i|e)"
vklopi: "vključi[te|mo]|vklopi[te|mo]|prižg[i|te]"
vključi: "vključi[te|mo]|vklopi[te|mo]|prižg[i|te]"
vključi: "(vključi|vklopi|prižgi)"
prižgi: "vključi[te|mo]|vklopi[te|mo]|prižg[i|te]"
izklopi: "izključi[te|mo]|ugasni[te|mo]|izklopi[te]"
izključi: "izključi[te|mo]|ugasni[te|mo|izklopi]"
Expand All @@ -394,7 +395,8 @@ expansion_rules:
katere: "katere"
koliko: "koliko"
kje_je: "kje je|kje|kje so|kje se nahaja[jo|ta]"
floor: "{floor} [prv(o|em)|drug(o|em)|tretj(e|em)|četrt(o|em)|pet(o|em)|šest(o|em)|sedm(o|em)|osm(o|em)|devet(em|o)] [ nadstropj[u|e|a]] | klet[i|em] | pritličj(e|u) | mansard(i|a)"
floor: "{floor}"
v: "[v|na|pri|ob|za|pred|pod]"
vse: "[vsi|vsa|vse|vso]"
vsa: "[vsi|vsa|vse|vso]"
lock: "vrat[a]|ključavnic(e|a|o)"
Expand All @@ -417,12 +419,9 @@ expansion_rules:
timer_set: "(zaženi|sproži|začni|nastavi|ustvari|kreiraj|štartaj|start|startaj)"
timer_cancel: "(prekliči|ustavi|stop|štop)"
timer_duration_seconds: "{timer_seconds:seconds} sekund[a|i|e]"
#timer_duration_minutes: "{timer_minutes:minutes} minut[ [in ]{timer_seconds:seconds} sekund[a|i|e]]"
timer_duration_minutes: "({timer_minutes:minutes} minut[e|i|o|a][ [in ]{timer_seconds:seconds} sekund[e|o|i|a]])|({timer_minutes:minutes} minut[e|o|i|a] in {timer_half:seconds})|({timer_half:seconds} minut[e|o|i|a])"
timer_duration_hours: "{timer_hours:hours} ur[a|i|e|o][ [in ]{timer_minutes:minutes} minut[a|i|e]][ [in ]{timer_seconds:seconds} sekund[a|i|e]]|({timer_hours:hours} [ur[i|o|a|e]] [in ] {timer_half:minutes} [ur[e|o|a|i]])|({timer_half:minutes} ur[e])"
#timer_duration_hours: "({timer_hours:hours} hour[s][ [and ]{timer_minutes:minutes} minute[s]][ [and ]{timer_seconds:seconds} second[s]])
timer_duration: "<timer_duration_seconds>|<timer_duration_minutes>|<timer_duration_hours>"

timer_start_seconds: "{timer_seconds:start_seconds} sekund[a|i|e|ni]"
timer_start_minutes: "{timer_minutes:start_minutes} minut[a|i|e|ni][ [in ]{timer_seconds:start_seconds} sekund[a|i|e|ni]]"
timer_start_hours: "{timer_hours:start_hours}ur[a|i|e|ni|o][ [in ]{timer_minutes:start_minutes} minut[a|i|e|ni|o]][ [in ]{timer_seconds:start_seconds} sekund[a|i|e|ni|o]]"
Expand Down
4 changes: 2 additions & 2 deletions sentences/sl/binary_sensor_HassGetState.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ intents:
device_class: cold

- sentences:
- "([ali] so|[ali] je) (kateri senzor| kaj) [zazna[l|no]|detektiral] (hlad[en|no]|mrz[el|lo]) [[v|na] <area>]"
- "([ali] so|[ali] je) (kater[i] senzor| kaj) [zazna[l|no]|detektiral] (hlad[en|no]|mrz[el|lo]) [[v|na] <area>]"
response: any
slots:
domain: binary_sensor
device_class: cold
state: "on"

- sentences:
- "[[ali] je|[ali] so] kateri senzor[ji] [je|so] [zaznal|detektiral] (hlad[ni|en|no]| mrz[li|el|lo]) [[v|na] <area>]"
- "kater(a|i) senzor[ji] (je|so) [zaznal|detektiral] (hlad[ni|en|no]| mrz[li|el|lo]) [[v|na] <area>]"
response: which_bs
slots:
domain: binary_sensor
Expand Down
47 changes: 39 additions & 8 deletions sentences/sl/cover_HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,52 @@ intents:
HassTurnOn:
data:
- sentences:
- "<odpri> garažna vrata"
response: "cover_device_class"
slots:
device_class: "garage"
domain: "cover"

- sentences:
- "<odpri> {cover_classes:device_class} [v|na] <area>"
- "<odpri> <area> {cover_classes:device_class}"
- "<odpri> {cover_classes:device_class} [v|na] [<area>]"
- "<odpri> <name> [v|na] [<area>]"
slots:
domain: cover
response: cover_device_class

- sentences:
- "<odpri> <name>"
- "<odpri> garaž[o|i|e]"
slots:
- "<odpri> <name> [[v|na] <area>]"
requires_context:
domain: cover
device_class: garage
response: cover_device_class

# # - sentences:
# # - "<odpri> [the] {cover_classes:device_class} [<in_here>]"
# # expansion_rules:
# # in_here: "[in] here"
# # slots:
# # domain: cover
# # response: cover_device_class
# # requires_context:
# # area:
# # slot: true
# - sentences:
# #- "<odpri> <area> {cover_classes:device_class}"
# - "<odpri> {cover_classes:device_class} [[v|na] <area>]"
# #- "<odpri> <name> [[v|na] <area>]"
# #- "<open> <name> [in <area>]"
# requires_context:
# domain: cover
# response: cover

# # - sentences:
# # - "<odpri> <name>"
# # - "<odpri> garaž[o|i|e]"
# # slots:
# # domain: cover
# # device_class: garage
# # response: cover_device_class

- sentences:
- "<odpri> <name>"
requires_context:
Expand All @@ -33,7 +64,7 @@ intents:
- shade
- shutter
- window
response: cover_single
response: cover

- sentences:
- "<odpri> <name> [v|na] <area>"
Expand All @@ -50,7 +81,7 @@ intents:
- shade
- shutter
- window
response: cover_single
response: cover

- sentences:
- "<odpri> {cover_classes:device_class} [<in_here>]"
Expand Down
10 changes: 4 additions & 6 deletions sentences/sl/fan_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ intents:
HassTurnOff:
data:
- sentences:
- "<izključi> [vse|vso] (ventilator[je]|ventilacijo|prezračevanje) [v|na] <area>"
- "<izklopi> [vse|vso] (ventilator[je]|ventilacijo|prezračevanje) [v|na] <area>"
- "<izključi> <area> (ventilator[je]|ventilacijo|prezračevanje)"
- "(izključi|izklopi|ugasni) [vse|vso] (<ventilator> [v] (<area> | <floor>) |[v] (<area>|<floor>) <ventilator>)"
slots:
domain: "fan"
response: fans_area

- sentences:
- "<izklopi> [vse|vso] (ventilatorje|ventilacijo)"
response: "fans_area"
- "<izklopi> (vse|vso) <ventilator>"
response: "fan_all"
slots:
domain: "fan"
name: "all"
#name: "all"
6 changes: 3 additions & 3 deletions sentences/sl/fan_HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ intents:
HassTurnOn:
data:
- sentences:
- "<vključi> [vse|vso] (ventilator[je]|ventilacijo|napo) [v|na] <area>"
- "<vključi> [vse|vso] <area> (ventilator[je]|ventilacijo)"
- "(vključi|vklopi|prižgi) [vse|vso] ((<ventilator> [v] <area>) | [v] (<area>|<floor>)|[v] (<area>|<floor>) <ventilator>)"
#- "<vključi> [vse|vso] <area> <ventilator>"
slots:
domain: "fan"
response: fans_area
Expand All @@ -14,4 +14,4 @@ intents:
response: "fans_area"
slots:
domain: "fan"
name: "all"
#name: "all"
2 changes: 1 addition & 1 deletion sentences/sl/homeassistant_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ intents:
#- "<izklopi> {name} [v|na] {area}"
#- "<izključi> {name}"
#- "<izključi> {name} [v|na] {area}"
- "(izključi|izklopi|ugasni) (<area> <name>|<name> [[v|na] <area>])"
- "<izklopi> (<area> <name>|<name> [[v|na] <area>])"
#response: default_name
expansion_rules:
izklopi: "(iz(ključi|klopi)|ugasni)"
Expand Down
23 changes: 6 additions & 17 deletions tests/sl/_fixtures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ areas:
- name: "dnevna soba|dnevni sobi|dnevne sobe|dnevn(a|i)"
id: living_room
floor: "prv(o|em) nadstropj(u|e)"
- name: "kopalni(ca|ci|co|cah|cama|ška|ški|ške)"
- name: "kopalni(ca|ci|co|cah|cama|ška|ški|ške|ško)"
id: bathroom
floor: "drug(o|em) nadstropj(u|e)"
- name: "utility"
Expand All @@ -60,7 +60,7 @@ entities:
area: balcony
state: "off"

- name: "kuhinjs(ko|ka|ki) stikal(o|la|li)|tipk(a|lo|li)"
- name: "stikal(o|la|li)|tipk(a|o|i|e|lo|li)"
id: switch.kitchen
area: kitchen
state: "on"
Expand All @@ -85,12 +85,7 @@ entities:
area: living_room
state: "on"

- name: "[stropn(i|o|a)] ventila(cijo|cije|tor|torje|torja) [na stropu]"
id: fan.ceiling
area: living_room
state: "on"

- name: "[kuhinjsk(a|o|e)] [ventila(cijo|tor|ja|torji|torje)] [napa|napo]"
- name: "nap(a|o)"
id: fan.kitchen_hood
area: kitchen
state: "on"
Expand All @@ -100,7 +95,7 @@ entities:
area: living_room
state: "on"

- name: "lev(a|o|i|e) zaves(a|i|o|e)"
- name: "levo zaveso"
id: cover.curtain_left
area: living_room
state: "open"
Expand Down Expand Up @@ -142,25 +137,19 @@ entities:
attributes:
device_class: blinds

- name: "kopalnišk(o|a|i) okn(a|o|i)"
- name: "levo okno"
id: cover.bathroom_window
area: "bathroom"
state: "open"
attributes:
device_class: window

- name: "strešno okno"
- name: "strešno"
id: cover.ceiling_window
area: "kitchen"
state: "open"
attributes:
device_class: window
- name: "kuhinj(sko|ski|ska) okn(o|a|i)"
id: cover.kitchen_window
area: "kitchen"
state: "open"
attributes:
device_class: window

#door
- name: "vhodna vrata"
Expand Down
34 changes: 17 additions & 17 deletions tests/sl/_test_failures.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
language: sl
sentences:
- "ali je kateri senzor zaznal hladno?"
- "odpri kuhinjska okna"
- "Izključi ventilator v dnevni sobi"
- "Vključi ventilatorje v kuhinji"
- "odpri garažo"
- "odpri strešno okno v kuhinji"
- "odpri vhodna vrata"
- "Vklopi ventilator v kuhinji"
- "Vklopi ventilacijo v kuhinji"
- "Vključi ventilatorje"
- "Izključi kuhinjsko ventilacijo"
- "Izključi ventilacijo v kuhinji"
- "Izključi kuhinjski ventilator"
- "Izključi ventilatorje"
- "Izključi ventilacijo"
- "ali veš katera stikala so vklopljena v kuhinji?"
- "ali veš katere luči so vključene?"
- "ali je kateri senzor zaznal hladno?" # fixed
- "odpri kuhinjska okna" #fixed
- "Izključi ventilator v dnevni sobi" #fixed casing
- "Vključi ventilatorje v kuhinji" #fixed - casing
- "odpri garažo" #fixed
- "odpri strešno okno v kuhinji" #fixed
- "odpri vhodna vrata" #fixed
- "Vklopi ventilator v kuhinji" #fixed - casing
- "Vklopi ventilacijo v kuhinji" #fixed - casing
- "Vključi ventilatorje" #fixed - casing
- "Izključi kuhinjsko ventilacijo" #fixed
- "Izključi ventilacijo v kuhinji" #fixed
- "Izključi kuhinjski ventilator" #fixed
- "Izključi ventilatorje" #fixed
- "Izključi ventilacijo" #fixed
- "ali veš katera stikala so vklopljena v kuhinji?" #fixed
- "ali veš katere luči so vključene?" #fixed
2 changes: 1 addition & 1 deletion tests/sl/binary_sensor_HassGetState.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ tests:

- sentences:
- "je kaj zaznano hladno?"
- "ali je kateri senzor zaznal hladno?"
#- "ali je kateri senzor zaznal hladno?"
- "ali je kaj zaznano mrzlo?"
intent:
name: HassGetState
Expand Down
4 changes: 2 additions & 2 deletions tests/sl/cover_HassGetState.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tests:
area: "dnevni sobi"
device_class: curtain
state: "open"
response: "Da, leva zavesa"
response: "Da, levo zaveso"
- sentences:
- "ali so zaprta vsa okna v kuhinji?"
intent:
Expand All @@ -39,7 +39,7 @@ tests:
area: "kuhinji"
device_class: window
state: "closed"
response: "Ne, nista kuhinjsko okno in strešno okno"
response: "Ne, ni strešno"
- sentences:
- "katera vrata so odprta?"
intent:
Expand Down
Loading

0 comments on commit eb08a2e

Please sign in to comment.