Skip to content

Commit

Permalink
[SL] added person_HassGetState, sentences, tests, fixed fixtures, com…
Browse files Browse the repository at this point in the history
…mon, responses (home-assistant#1693)
  • Loading branch information
andrejs2 authored Nov 29, 2023
1 parent 5b7e117 commit c4f42d0
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 0 deletions.
7 changes: 7 additions & 0 deletions responses/sl/HassGetState.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ responses:
how_many: |
{{ query.matched | length }}
where: |
{% if state == "not_home" %}
{{ slots.name | capitalize }} ni doma
{% else %}
{{ slots.name | capitalize }} je {{ state.state }}
{% endif %}
sensor_value: |
Vrednost senzorja je {{ state.state_with_unit }}
Expand Down
11 changes: 11 additions & 0 deletions sentences/sl/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ lists:
out: "unlocked"
shopping_list_item:
wildcard: true
zone:
wildcard: true

# binary sensors
bs_presence_states:
values:
- in: "(doma|prisoten)"
out: "on"
- in: "(proč|ni prisoten)"
out: "off"
expansion_rules:
name: "{name}"
area: "[v | na] {area}[sob[o|e|i|ah]| prostor[u||e|a|ih]| kuhinj(i|a|skem|ski|ske|sko) [prosto[r|ru|re|rih]]| dnevn(i|em|ih) [prostor[u|ih]]| dnevn(i|a) sob(i|a)| spalni(ca|ci)]| zuna(nja|j)"
Expand Down Expand Up @@ -131,6 +141,7 @@ expansion_rules:
kakšna_je: "kakšna je|povej [mi]"
kakšno_je: "kakšno je|povej [mi]"
koliko: "koliko"
kje_je: "kje je|kje|kje so|kje se nahaja[jo|ta]"
vse: "[vsi|vsa|vse|vso]"
vsa: "[vsi|vsa|vse|vso]"
lock: "vrata"
Expand Down
44 changes: 44 additions & 0 deletions sentences/sl/person_HassGetState.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
language: sl
intents:
HassGetState:
data:
# https://www.home-assistant.io/integrations/person/
- sentences:
- "<kje_je> <name>"
response: where
requires_context:
domain: person
slots:
domain: person

- sentences:
- "[ali] je <name> [v|na] {zone:state}"
response: one_yesno
requires_context:
domain: person
slots:
domain: person

- sentences:
- "[ali] je (nekdo|kdo) [v|na] {zone:state}"
response: any
slots:
domain: person

- sentences:
- "ali so vsi [v|na] {zone:state}"
response: all
slots:
domain: person

- sentences:
- "kdo je [v|na] {zone:state}"
response: which
slots:
domain: person

- sentences:
- "koliko (oseb|ljudi) je [v|na] {zone:state}"
response: how_many
slots:
domain: person
9 changes: 9 additions & 0 deletions tests/sl/_fixtures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,12 @@ entities:
attributes:
temperature: "28"
temperature_unit: "stopinj"
- name: "Lev"
id: "person.Lev"
state: "doma"
- name: "Arya"
id: "person.arya"
state: "v službi"
- name: "Jon"
id: "person.jon"
state: "ni doma"
65 changes: 65 additions & 0 deletions tests/sl/person_HassGetState.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
language: sl
tests:
- sentences:
- "kje je Lev"
intent:
name: HassGetState
slots:
domain: person
name: Lev
response: "Lev je doma"

- sentences:
- "Kje je Arya"
intent:
name: HassGetState
slots:
domain: person
name: Arya
response: "Arya je v službi"

- sentences:
- "ali je Arya doma"
intent:
name: HassGetState
slots:
domain: person
name: Arya
state: doma
response: "Ne"

- sentences:
- "ali je kdo doma"
intent:
name: HassGetState
slots:
domain: person
state: doma
response: "Da, Lev"

- sentences:
- "ali so vsi doma"
intent:
name: HassGetState
slots:
domain: person
state: doma
response: "Ne, nista Arya in Jon"

- sentences:
- "kdo je doma"
intent:
name: HassGetState
slots:
domain: person
state: doma
response: "Lev"

- sentences:
- "koliko oseb je doma"
intent:
name: HassGetState
slots:
domain: person
state: doma
response: "1"

0 comments on commit c4f42d0

Please sign in to comment.