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

[SV] Locks sentences #2395

Merged
merged 5 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions responses/sv/HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ responses:
cover: "Stängde {{ slots.name }}"
cover_area: "Stängde i {{ slots.area }}"
cover_device_class: "Stängde {{ slots.device_class }}"
lock: "Låste upp"
frli4797 marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions responses/sv/HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ responses:
cover: "Öppnade {{ slots.name }}"
cover_area: "Öppnade i {{ slots.area }}"
cover_device_class: "Öppnade {{ slots.device_class }}"
lock: "Låste"
7 changes: 7 additions & 0 deletions sentences/sv/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ lists:
out: 100
- in: <minimal>
out: 1
lock_states:
values:
- in: "[säkert ]låst"
out: "locked"
- in: "upplåst"
out: "unlocked"
on_off_states:
values:
- in: "på|igång|tända|tänd|påslagna"
Expand Down Expand Up @@ -335,6 +341,7 @@ expansion_rules:
alla: "(all | alla | allt)"
ljusintensitet: "(ljusstyrka | intensitet | styrka | nivå | effekt)"
ljuskällor: "(ljuskällor[na]|ljus[en|et]|[glöd|led|diod]lamp[a|an|or|orna]|lysrör[en|et]|belysning[en])"
låsbar: "(lås[en]|dörr[ar|en|arna]|fönster|grind[ar|en|arna]|garagedörr[ar|en|arna])"
dimra: "(ändra | sätt | vrid | dra [på] | skruva [på] | dimra | dimma | ställ [in] | höj | sänk)"
möjliga: "(möjlig[a] | tillgänglig[a])"
maximal: "(maximal | max[imum] | högsta | starkaste | intensivaste | full[t])"
Expand Down
17 changes: 17 additions & 0 deletions sentences/sv/lock_HassTurnOff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: sv
intents:
HassTurnOff:
data:
- sentences:
- "lås upp <name>[ i_på <area>]"
requires_context:
domain: lock
response: lock

- sentences:
- "lås upp [<alla>] <låsbar> <i_på> <area>"
- "lås upp [<alla>] <area> <låsbar>"
slots:
domain: "lock"
name: "alla"
Copy link
Contributor

Choose a reason for hiding this comment

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

I would expect that this sentence should set the name to "all" and not "alla". Since it is not translated slot name.
Looking at DE and ES languages for example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh. My bad. Fixed in latest commit.

response: lock
18 changes: 18 additions & 0 deletions sentences/sv/lock_HassTurnOn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: "sv"

intents:
HassTurnOn:
frli4797 marked this conversation as resolved.
Show resolved Hide resolved
data:
- sentences:
- "lås <name>[ i <area>]"
requires_context:
domain: lock
response: lock

- sentences:
- "lås [<alla>] <låsbar> <i_på> <area>"
- "lås [<alla>] <area> <låsbar>"
slots:
domain: "lock"
name: "alla"
response: lock
9 changes: 9 additions & 0 deletions tests/sv/_fixtures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ areas:
id: garage
- name: Bastu
id: sauna
- name: Hallen
id: hallen

entities:
- name: garagelampa
id: light.garage_light
Expand Down Expand Up @@ -92,6 +95,12 @@ entities:
- name: Rover
id: vacuum.rover
area: livingroom
- name: Ytterdörren
id: lock.ytterdorren
area: hallen
- name: Bakdörren
id: lock.backdorren
area: hallen

- name: "Stockholm"
id: "weather.stockholm"
Expand Down
21 changes: 21 additions & 0 deletions tests/sv/lock_HassTurnOff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: sv
tests:
- sentences:
- "Lås upp Ytterdörren"
intent:
name: HassTurnOff
context:
domain: lock
slots:
name: Ytterdörren
response: "Låste upp"
- sentences:
- "lås upp alla lås i hallen"
- "Lås upp alla dörrar i hallen"
intent:
name: HassTurnOff
slots:
area: Hallen
domain: lock
name: alla
response: "Låste upp"
23 changes: 23 additions & 0 deletions tests/sv/lock_HassTurnOn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
language: sv
tests:
- sentences:
- lås Ytterdörren
intent:
name: HassTurnOn
context:
domain: lock
slots:
name: Ytterdörren
response: Låste
frli4797 marked this conversation as resolved.
Show resolved Hide resolved

- sentences:
- "Lås alla låsen i hallen"
- "Lås alla dörrarna i hallen"
- "Lås alla hallens dörrar"
intent:
name: HassTurnOn
slots:
area: Hallen
domain: lock
name: alla
response: Låste