Skip to content

Commit

Permalink
[GL] SetPosition intents (#2723)
Browse files Browse the repository at this point in the history
  • Loading branch information
cibernox authored Dec 5, 2024
1 parent 3bf5fdd commit 726f7ee
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 0 deletions.
5 changes: 5 additions & 0 deletions responses/gl/HassSetPosition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: gl
responses:
intents:
HassSetPosition:
default: "Posición establecida"
43 changes: 43 additions & 0 deletions sentences/gl/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,44 @@ lists:
out: fan
- in: (interrutor|interrutores)
out: switch
cover_states:
values:
- in: "abert(o|a)[s]"
out: "open"
- in: "pechad(o|a)[s]"
out: "closed"
- in: "abréndose"
out: "opening"
- in: "pechándose"
out: "closing"
cover_classes:
values:
- in: "toldo[s]"
out: awning
- in: persiana[s]
out: blind
- in: cortina[s]
out: curtain
- in: porta[s]
out: door
- in: (porta[s]|cancela[s]|portón|portons) de garaxe
out: garage
- in: verxa[s]|cancela[s]|portón|portons
out: gate
- in: estor[es]
out: shade
- in: (contraventá[s]|veneciana[s])
out: shutter
- in: ventá[s]
out: window
shopping_list_item:
wildcard: true

position:
range:
type: "percentage"
from: 0
to: 100
temperature:
range:
type: "temperature"
Expand Down Expand Up @@ -112,23 +148,28 @@ lists:
wildcard: true

expansion_rules:
abre: "(abr(e|ir)|<sube>)"
acende: "(enciende[r]|acende[r]|prende[r]|activa[r])"
apaga: "(apag(a|ar)|desconect(a|ar)|desactiv(a|ar))"
algun: "(algún|algunha|algúns|algunhas)"
area: "[en | no | na | de | do | da | o | a ]{area}"
baixa: "([a]baix(a|ar)|redu(ce|cir)|decrement(a|ar)|disminu(e|ir))"
brightness: "{brightness}[%| porcento]"
cal_e_a_medida_do_sensor: "([dime ]<cal> [é (a|o)] [(cantidade|medida)|nivel (de|da|do)] | cant(o|a)[s]) <class> (de|do|da|en|no|na|dende|<que_marca>) <nome> [<area>]"
cal_e: "([<dime> ]cal é [o |a ]|[<dime> ]cales son [os |as ]|[<dime> ]c(o|ó)mo (vai|está|marcha|se atopa)[n] [o |a |os |as ])"
cal: "(qu[e|é]|cal|cales)"
casa: "[d(e|o|a) | n(o|a) ](casa|apartamento|piso)"
cancela: "cancel(a[r])"
pecha: "(pech(a|ar)|<baixa>)"
crea: "(cre(a|ar))"
de_aqui: "[de ](aquí|acá|(n(o|a)) <habitación>)"
dime: "(d(í|i)[s|ga]me|sabes[ me][ d(e|i)cir])"
elimina: "(elimin(a|ar)|borr(a|ar))"
engadir: "(engada | engade)"
esta: "(está|están|existe|existen|hai)"
establece: "(pon|establec(e|er)|axust(a|ar)|configur(a|ar)|cambi(a[r]))"
establece_abre_pecha: "(<establece>|<abre>|<pecha>)"
establece_sube_baixa: "(<establece>|<enciende>|<sube>|<baixa>)"
inicia: "(inici(a|ar)|come[n](za|zar)|emp[i]e(za|zar))"
luces: "[(a|o)[s] ](luz|luces|lámpada[s]|bombilla[s]|foco[s]|interruptor[es][ da luz])"
meu: "(o meu|a miña|os meus|as miñas)"
Expand All @@ -142,7 +183,9 @@ expansion_rules:
temperature: "{temperature} [graos] [{temperature_unit}]"
todos: "(todos[ os]|todas[ as]|tódolos|tódalas|cada un d(o|a)s)"
habitación: "(habitaci(ón|ons)|cuarto[s]|sala[s])"
posición: "{position}[ ][%|por[ ]cen[to]]"
todas_partes: "[en |de ][todas partes ][d(o|a) ]<casa>"
sube: "(sub(e|ir)|levant(a|ar)|aument(a|ar)|increment(a|ar))"
# Temporizadores
temporizador: "[o |a ](temporizador|conta atrás)"
temporizadores: "[o |a |(o|a)s ](temporizador[es]|conta[s] atrás)"
Expand Down
17 changes: 17 additions & 0 deletions sentences/gl/cover_HassSetPosition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: gl
intents:
HassSetPosition:
data:
- sentences:
- "<establece_abre_pecha> [[a ]posición [d[e|o|a]]] <nome> (ao|ó) <posición>"
requires_context:
domain: cover
slots:
domain: cover

- sentences:
- "<establece_abre_pecha> [[a ]posición [do[s]|da[s] ]][o[s]|a[s]] {cover_classes:device_class} ((ao|ó) <posición>;<area>)"
- "<establece_abre_pecha> [[a ]posición [do[s]|da[s] ]][o[s]|a[s]] {cover_classes:device_class} (<area>;(ao|ó) <posición>)"
- "<establece_abre_pecha> <area> [[a ]posición [do[s]|da[s]]] {cover_classes:device_class} (ao|ó) <posición>"
slots:
domain: cover
10 changes: 10 additions & 0 deletions sentences/gl/valve_HassSetPosition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: gl
intents:
HassSetPosition:
data:
- sentences:
- "<establece_abre_pecha> [[a ]posición [d[e|a|o]]] <nome> (ao|ó) <posición>"
requires_context:
domain: valve
slots:
domain: valve
15 changes: 15 additions & 0 deletions tests/gl/_fixtures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ areas:
floor: basement_id

entities:
- name: Cortina dormitorio
id: cover.cortina_dormitorio
area: id_dormitorio
state:
in: "cerrada"
out: "closed"
attributes:
device_class: curtain
position: "0"

- name: Lámpada
id: light.lampada_dormitorio
area: id_dormitorio
Expand Down Expand Up @@ -132,6 +142,11 @@ entities:
id: "todo.tarefas"
state: ""

- name: "Chave de paso"
id: "valve.chave_de_paso"
state: "open"
attributes:
position: "100"
# https://www.home-assistant.io/integrations/sensor/
- name: "medidor de potencia"
id: "sensor.appliance_apparent_power"
Expand Down
24 changes: 24 additions & 0 deletions tests/gl/cover_HassSetPosition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language: gl
tests:
- sentences:
- "abre a cortina dormitorio ao 50%"
intent:
name: HassSetPosition
slots:
domain: cover
name: "Cortina dormitorio"
position: 50
response: "Posición establecida"

- sentences:
- "axusta a cortina do dormitorio ao 50%"
- "abre as cortinas ao 50 por cento no dormitorio"
- "levantar no dormitorio cortinas ao 50 por cento"
intent:
name: HassSetPosition
slots:
domain: cover
device_class: "curtain"
area: "Dormitorio"
position: 50
response: "Posición establecida"
13 changes: 13 additions & 0 deletions tests/gl/valve_HassSetPosition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: gl
tests:
- sentences:
- "axusta chave de paso ao 100"
- "incrementar posición da chave de paso ao 100%"
- "abrir chave de paso ao 100 por cento"
intent:
name: HassSetPosition
slots:
domain: valve
name: "Chave de paso"
position: 100
response: "Posición establecida"

0 comments on commit 726f7ee

Please sign in to comment.