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

[PT] Improve cover intent #2101

Merged
merged 3 commits into from
Mar 25, 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: 7 additions & 5 deletions sentences/pt/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ lists:
out: switch
cover_states:
values:
- in: "(aberto|aberta|abertas)"
- in: "(aberto|aberta|abertos|abertas)"
out: "open"
- in: "(fechado|fechada|fechadas)"
- in: "(fechado|fechada|fechados|fechadas)"
out: "closed"
- in: "a abrir"
out: "opening"
Expand All @@ -91,22 +91,24 @@ lists:
values:
- in: (toldo[s]|tolde[s])
out: awning
- in: persiana[s]
- in: estore[s]
out: blind
- in: cortina[s]
out: curtain
- in: porta[s]
out: door
- in: (porta[s] da garagem|portão|portões)
- in: (porta[s]|portão|portões) da garagem
out: garage
- in: (portão|portões)
out: gate
- in: (toldo[s]|tolde[s])
- in: sombra[s]
out: shade
- in: persiana[s]
out: shutter
- in: janela[s]
out: window
- in: registo[s]
out: damper
lock_states:
values:
- in: "(trancad[a[s]|o[s]])"
Expand Down
2 changes: 1 addition & 1 deletion sentences/pt/cover_HassGetState.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ intents:
domain: cover

- sentences:
- "quantas {cover_classes:device_class} estão {cover_states:state} [<na_zona>]"
- "(quantas|quantos) {cover_classes:device_class} estão {cover_states:state} [<na_zona>]"
response: how_many
slots:
domain: cover
14 changes: 14 additions & 0 deletions tests/pt/_fixtures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@ entities:
attributes:
device_class: curtain

- name: "Estores da Sala de Estar"
id: "cover.sala"
area: "sala_de_estar"
state: "open"
attributes:
device_class: blind

- name: "Persiana da Cozinha"
id: "cover.cozinha"
area: "cozinha"
state: "closed"
attributes:
device_class: shutter

- name: "Temperatura exterior"
id: "sensor.temperatura_exterior"
area: "garagem"
Expand Down
20 changes: 20 additions & 0 deletions tests/pt/cover_HassGetState.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,23 @@ tests:
device_class: curtain
state: "closed"
response: "2"

- sentences:
- "Quantos estores estão abertos?"
intent:
name: HassGetState
slots:
domain: cover
device_class: blind
state: "open"
response: "1"

- sentences:
- "Quantas persianas estão fechadas?"
intent:
name: HassGetState
slots:
domain: cover
device_class: shutter
state: "closed"
response: "1"