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] room awareness for covers #2235

Merged
merged 8 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
5 changes: 5 additions & 0 deletions responses/pt/HassSetPosition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: pt
responses:
intents:
HassSetPosition:
default: "Posição alterada"
9 changes: 9 additions & 0 deletions sentences/pt/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ lists:
shopping_list_item:
wildcard: true

position:
range:
type: "percentage"
from: 0
to: 100

expansion_rules:
abre: "(abra|abre|abrir)"
adicionar: adicione|adiciona[r]
Expand All @@ -136,6 +142,9 @@ expansion_rules:
qual: "(que|qual|qual é|quais)"
temperatura: "{temperature}[°| graus] [{temperature_unit}]"
zona: "[(o|os|a|as)] {area}"
estores: "(cortina|cortinas|cortinado|cortinados|estore|estores|persiana|persianas)"
definir_valor: "(coloca|muda|aumenta|sobe|diminui|baixa)"
abmantis marked this conversation as resolved.
Show resolved Hide resolved
posicao: "{position}[[ ]%| porcento]"

skip_words:
- "por favor"
Expand Down
25 changes: 25 additions & 0 deletions sentences/pt/cover_HassSetPosition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
language: pt
intents:
HassSetPosition:
data:
- sentences:
- "(<definir_valor>|<abre>|<fecha>) <nome> (para|até) <posicao>"
requires_context:
domain: cover
slots:
domain: cover

- sentences:
- "(<definir_valor>|<abre>|<fecha>) [as|os|a|o] {cover_classes:device_class} ((para|até) <posicao>;<na_zona>)"
- "(<definir_valor>|<abre>|<fecha>) <na_zona> [as|os|a|o] {cover_classes:device_class} (para|até) <posicao>"
slots:
domain: cover

# set estores na mesma divisão que um dispositivo de voz
- sentences:
- "(<definir_valor>|<abre>|<fecha>) [as|os|a|o] <estores> (para|até) <posicao>"
slots:
domain: cover
requires_context:
area:
slot: true
P2mb2 marked this conversation as resolved.
Show resolved Hide resolved
17 changes: 16 additions & 1 deletion sentences/pt/cover_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,27 @@ intents:
slots:
device_class: garage
domain: cover

- sentences:
- <fecha> [as|os|a|o] [(cortina|cortinas|cortinado|cortinados|estore|estores|persiana|persianas)] <na_zona>
- <fecha> [as|os|a|o] <estores> <na_zona>
abmantis marked this conversation as resolved.
Show resolved Hide resolved
response: cover
slots:
device_class:
- blind
- curtain
- shutter
domain: cover

# fechar estores na mesma divisão que um dispositivo de voz
- sentences:
- <fecha> [as|os|a|o] <estores> [aqui]
abmantis marked this conversation as resolved.
Show resolved Hide resolved
response: cover
slots:
device_class:
abmantis marked this conversation as resolved.
Show resolved Hide resolved
- blind
- curtain
- shutter
domain: cover
requires_context:
area:
slot: true
16 changes: 15 additions & 1 deletion sentences/pt/cover_HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,25 @@ intents:
domain: cover

- sentences:
- <abre> [as|os|a|o] [(cortina|cortinas|cortinado|cortinados|estore|estores|persiana|persianas)] <na_zona>
- <abre> [as|os|a|o] <estores> <na_zona>
abmantis marked this conversation as resolved.
Show resolved Hide resolved
response: cover
slots:
device_class:
- blind
- curtain
- shutter
domain: cover

# abrir estores na mesma divisão que um dispositivo de voz
- sentences:
- <abre> [as|os|a|o] <estores> [aqui]
abmantis marked this conversation as resolved.
Show resolved Hide resolved
response: cover
slots:
device_class:
- blind
- curtain
- shutter
domain: cover
requires_context:
area:
slot: true
P2mb2 marked this conversation as resolved.
Show resolved Hide resolved
41 changes: 41 additions & 0 deletions tests/pt/cover_HassSetPosition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
language: pt
tests:
- sentences:
- "abre a persiana da cozinha para 50%"
- "fecha a persiana da cozinha para 50%"
- "muda a persiana da cozinha para 50%"
intent:
name: HassSetPosition
slots:
domain: cover
name: "Persiana da Cozinha"
position: 50
response: "Posição alterada"

- sentences:
- "abre na cozinha a persiana para 60%"
- "abre a persiana para 60% na cozinha"
intent:
name: HassSetPosition
slots:
domain: cover
device_class:
- blind
- curtain
- shutter
area: Cozinha
position: 60
response: "Posição alterada"

# set na mesma divisão que um dispositivo de voz
- sentences:
- abre a persiana para 80%
intent:
name: HassSetPosition
context:
area: Cozinha
slots:
domain: cover
area: Cozinha
position: 80
response: "Posição alterada"
18 changes: 18 additions & 0 deletions tests/pt/cover_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tests:
device_class: garage
domain: cover
response: Fechado

- sentences:
- fecha as cortinas no cozinha
- fecha a persiana da cozinha
Expand All @@ -21,3 +22,20 @@ tests:
- shutter
domain: cover
response: Fechado

- sentences:
- fecha as cortinas
- fecha a persiana
- fecha a persiana aqui
intent:
name: HassTurnOff
context:
area: Cozinha
slots:
area: Cozinha
device_class:
- blind
- curtain
- shutter
domain: cover
response: Fechado
P2mb2 marked this conversation as resolved.
Show resolved Hide resolved
17 changes: 17 additions & 0 deletions tests/pt/cover_HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,20 @@ tests:
- shutter
domain: cover
response: Aberto

- sentences:
- abra as cortinas
- abre a persiana
- abre a persiana aqui
intent:
name: HassTurnOn
context:
area: Cozinha
slots:
area: Cozinha
device_class:
- blind
- curtain
- shutter
domain: cover
response: Aberto
Loading