From dfacf2ce8467b87f560ec9d43568c25b98a17962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mar=C3=ADn?= <292309+davefx@users.noreply.github.com> Date: Tue, 14 Nov 2023 07:33:37 +0100 Subject: [PATCH 1/7] Fix #1602 (#1639) * Fixing problems with shopping list sentences (Fixes #1602) --- sentences/es/_common.yaml | 2 +- sentences/es/shopping_list_HassShoppingListAddItem.yaml | 4 ++-- tests/es/shopping_list_HassShoppingListAddItem.yaml | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sentences/es/_common.yaml b/sentences/es/_common.yaml index aa5a9bd84d..708cbc17a9 100644 --- a/sentences/es/_common.yaml +++ b/sentences/es/_common.yaml @@ -303,7 +303,7 @@ lists: expansion_rules: abre: "(abr(a|e|ir|í)|sub(a|e|ir|í))" ahora: "[ahora [mismo]|actualmente|en este momento]" - añadir: "(añad(a|e|ir|í)|pon[ga|er|é])" + añadir: "(añad(a|e|ir|í)|apunt[a|e|ar|á]|pon[ga|er|é])" apaga: "(apag(a|ue|ar|á)|desconect(a|e|ar|á)|desactiv(a|e|ar|á))" area: "[en|del|de] [el|la] {area}" brightness: "{brightness} [%|porciento|por ciento]" diff --git a/sentences/es/shopping_list_HassShoppingListAddItem.yaml b/sentences/es/shopping_list_HassShoppingListAddItem.yaml index f976a8d28a..80979333e1 100644 --- a/sentences/es/shopping_list_HassShoppingListAddItem.yaml +++ b/sentences/es/shopping_list_HassShoppingListAddItem.yaml @@ -3,8 +3,8 @@ intents: HassShoppingListAddItem: data: - sentences: - - (en|a) + - response: item_added expansion_rules: - my_list: "[ mi| la] lista [de] [la] [compra]" + my_list: "[en|a] [mi|la] lista [de] [la] [compra]" item: "{shopping_list_item:item}" diff --git a/tests/es/shopping_list_HassShoppingListAddItem.yaml b/tests/es/shopping_list_HassShoppingListAddItem.yaml index ab579f877c..f0f12ecefb 100644 --- a/tests/es/shopping_list_HassShoppingListAddItem.yaml +++ b/tests/es/shopping_list_HassShoppingListAddItem.yaml @@ -3,6 +3,8 @@ tests: - sentences: - añade manzanas a mi lista de la compra - poner manzanas en la lista de compra + - añadir manzanas a la lista de la compra + - apunta manzanas en lista intent: name: HassShoppingListAddItem slots: From 23a9667d8a7e052527bff2e5d46dc66cb9f57294 Mon Sep 17 00:00:00 2001 From: Tudor Sandu Date: Tue, 14 Nov 2023 00:34:26 -0800 Subject: [PATCH 2/7] [RO] Added todo_HassListAddItem (#1641) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "Adaugă lapte pe lista mea Lidl" --- responses/ro/HassListAddItem.yaml | 5 +++++ sentences/ro/todo_HassListAddItem.yaml | 13 +++++++++++++ tests/ro/_fixtures.yaml | 4 ++++ tests/ro/todo_HassListAddItem.yaml | 11 +++++++++++ 4 files changed, 33 insertions(+) create mode 100644 responses/ro/HassListAddItem.yaml create mode 100644 sentences/ro/todo_HassListAddItem.yaml create mode 100644 tests/ro/todo_HassListAddItem.yaml diff --git a/responses/ro/HassListAddItem.yaml b/responses/ro/HassListAddItem.yaml new file mode 100644 index 0000000000..2930897fbe --- /dev/null +++ b/responses/ro/HassListAddItem.yaml @@ -0,0 +1,5 @@ +language: "ro" +responses: + intents: + HassListAddItem: + item_added: "Am adăugat {{ slots.item }}" diff --git a/sentences/ro/todo_HassListAddItem.yaml b/sentences/ro/todo_HassListAddItem.yaml new file mode 100644 index 0000000000..547fd4eeb1 --- /dev/null +++ b/sentences/ro/todo_HassListAddItem.yaml @@ -0,0 +1,13 @@ +language: "ro" +intents: + HassListAddItem: + data: + - sentences: + - "adaug(ă|a) (la|pe|) " + - "pune (pe|) " + response: item_added + requires_context: + domain: todo + expansion_rules: + my_list: "[lista[ mea] ]{name}" + item: "{shopping_list_item:item}" diff --git a/tests/ro/_fixtures.yaml b/tests/ro/_fixtures.yaml index b694192742..9cd0cec39f 100644 --- a/tests/ro/_fixtures.yaml +++ b/tests/ro/_fixtures.yaml @@ -358,3 +358,7 @@ entities: out: "on" attributes: device_class: window + + - name: "Lidl" + id: "todo.lidl" + state: "" diff --git a/tests/ro/todo_HassListAddItem.yaml b/tests/ro/todo_HassListAddItem.yaml new file mode 100644 index 0000000000..ff6bb6fa13 --- /dev/null +++ b/tests/ro/todo_HassListAddItem.yaml @@ -0,0 +1,11 @@ +language: "ro" +tests: + - sentences: + - "adauga lapte pe lista mea lidl" + - "pune lapte in lista lidl" + intent: + name: HassListAddItem + slots: + item: "lapte " + name: "Lidl" + response: "Am adăugat lapte" From 23df80f29416ce18b81330ccb439304de055b2fa Mon Sep 17 00:00:00 2001 From: Tudor Sandu Date: Tue, 14 Nov 2023 01:02:43 -0800 Subject: [PATCH 3/7] Add HassGetWeather (#1642) --- responses/ro/HassGetWeather.yaml | 24 ++++++++++++++++++++++++ sentences/ro/weather_HassGetWeather.yaml | 10 ++++++++++ tests/ro/_fixtures.yaml | 14 ++++++++++++++ tests/ro/weather_HassGetWeather.yaml | 21 +++++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 responses/ro/HassGetWeather.yaml create mode 100644 sentences/ro/weather_HassGetWeather.yaml create mode 100644 tests/ro/weather_HassGetWeather.yaml diff --git a/responses/ro/HassGetWeather.yaml b/responses/ro/HassGetWeather.yaml new file mode 100644 index 0000000000..94ac13f3a9 --- /dev/null +++ b/responses/ro/HassGetWeather.yaml @@ -0,0 +1,24 @@ +language: ro +responses: + intents: + HassGetWeather: + default: > + {% set weather_condition = { + 'clear': 'cu cer senin', + 'clear-night': 'cu cer senin', + 'cloudy': 'și înnorat', + 'exceptional': 'și exceptional', + 'fog': 'cu ceață', + 'hail': 'cu grindină', + 'lightning': 'cu descărcări electrice', + 'lightning-rainy': 'cu ploaie însoțită de descărcări electrice', + 'partlycloudy': 'și parțial noros', + 'pouring': 'cu averse de ploaie', + 'rainy': 'cu ploaie', + 'snowy': 'cu ninsoare', + 'snowy-rainy': 'cu lapoviță', + 'sunny': 'și însorit', + 'windy': 'cu intensificări ale vântului', + 'windy-variant': 'înnorat, cu intensificări ale vântului' + } %} + {{ state.attributes.get('temperature') }} {{ state.attributes.get('temperature_unit') }} {{ weather_condition.get((state.state | string).lower(), "") }} diff --git a/sentences/ro/weather_HassGetWeather.yaml b/sentences/ro/weather_HassGetWeather.yaml new file mode 100644 index 0000000000..e03af8e192 --- /dev/null +++ b/sentences/ro/weather_HassGetWeather.yaml @@ -0,0 +1,10 @@ +language: ro +intents: + HassGetWeather: + data: + - sentences: + - "cum (vremea|afar(ă|a))[ [ ]]" + - "c(â|a)te grade sunt[ afar(ă|a)][ [ ]]" + - " (de (frig|cald);)[ (afar(ă|a)|[ ])]" + requires_context: + domain: weather diff --git a/tests/ro/_fixtures.yaml b/tests/ro/_fixtures.yaml index 9cd0cec39f..813f9a22bf 100644 --- a/tests/ro/_fixtures.yaml +++ b/tests/ro/_fixtures.yaml @@ -362,3 +362,17 @@ entities: - name: "Lidl" id: "todo.lidl" state: "" + + - name: "Bucuresti" + id: "weather.bucuresti" + state: "rainy" + attributes: + temperature: "18" + temperature_unit: "°C" + + - name: "Brasov" + id: "weather.brasov" + state: "clear" + attributes: + temperature: "22" + temperature_unit: "°C" diff --git a/tests/ro/weather_HassGetWeather.yaml b/tests/ro/weather_HassGetWeather.yaml new file mode 100644 index 0000000000..7851b6942e --- /dev/null +++ b/tests/ro/weather_HassGetWeather.yaml @@ -0,0 +1,21 @@ +language: ro +tests: + - sentences: + - "cum e vremea la Bucuresti?" + - "cate grade sunt la Bucuresti?" + - "cat de frig este in Bucuresti?" + intent: + name: HassGetWeather + slots: + name: Bucuresti + response: 18 °C cu ploaie + + - sentences: + - "cum este vremea in Brasov?" + - "cate grade sunt afara la Brasov?" + - "cat este de cald la Brasov" + intent: + name: HassGetWeather + slots: + name: Brasov + response: 22 °C cu cer senin From 991d8a0a21e59d71fbcb3bb2872ebffdbfb40213 Mon Sep 17 00:00:00 2001 From: Tudor Sandu Date: Tue, 14 Nov 2023 02:21:56 -0800 Subject: [PATCH 4/7] Improve sentences for light_HassTurnOn/Off (#1644) The context-aware sentences were already in place in Romanian (see #1632) but I've added "[[from|in] here]" in the sentences. "aprinde luminile de aici" "stinge lumina aici" --- sentences/ro/light_HassTurnOff.yaml | 2 +- sentences/ro/light_HassTurnOn.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sentences/ro/light_HassTurnOff.yaml b/sentences/ro/light_HassTurnOff.yaml index 6f915277b2..e9b618566b 100644 --- a/sentences/ro/light_HassTurnOff.yaml +++ b/sentences/ro/light_HassTurnOff.yaml @@ -16,7 +16,7 @@ intents: domain: light response: lights_area - sentences: - - " ( | [toate] )" + - " ( | [toate] )[ [de ]aici]" slots: domain: light requires_context: diff --git a/sentences/ro/light_HassTurnOn.yaml b/sentences/ro/light_HassTurnOn.yaml index 5d836d7a1d..515a038831 100644 --- a/sentences/ro/light_HassTurnOn.yaml +++ b/sentences/ro/light_HassTurnOn.yaml @@ -16,7 +16,7 @@ intents: domain: light response: lights_area - sentences: - - " ( | [toate] )" + - " ( | [toate] )[ [de ]aici]" slots: domain: light requires_context: From cccc37f285c81a512224d3e36d586ba4c21edffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mar=C3=ADn?= <292309+davefx@users.noreply.github.com> Date: Tue, 14 Nov 2023 11:59:24 +0100 Subject: [PATCH 5/7] [ES] Updating translations to 2023.11.13 release (#1645) --- responses/es/HassGetState.yaml | 37 +++++++++++-- responses/es/HassGetWeather.yaml | 24 +++++++++ responses/es/HassListAddItem.yaml | 5 ++ sentences/es/_common.yaml | 5 ++ sentences/es/light_HassTurnOff.yaml | 10 +++- sentences/es/light_HassTurnOn.yaml | 8 +++ sentences/es/lock_HassGetState.yaml | 1 + sentences/es/lock_HassTurnOff.yaml | 8 +-- sentences/es/lock_HassTurnOn.yaml | 8 +-- sentences/es/person_HassGetState.yaml | 44 ++++++++++++++++ sentences/es/todo_HassListAddItem.yaml | 12 +++++ sentences/es/weather_HassGetWeather.yaml | 8 +++ tests/es/_fixtures.yaml | 30 +++++++++++ tests/es/light_HassTurnOff.yaml | 12 +++++ tests/es/light_HassTurnOn.yaml | 14 +++++ tests/es/lock_HassGetState.yaml | 1 + tests/es/lock_HassTurnOff.yaml | 2 + tests/es/person_HassGetState.yaml | 66 ++++++++++++++++++++++++ tests/es/todo_HassListAddItem.yaml | 24 +++++++++ tests/es/weather_HassGetWeather.yaml | 17 ++++++ 20 files changed, 322 insertions(+), 14 deletions(-) create mode 100644 responses/es/HassGetWeather.yaml create mode 100644 responses/es/HassListAddItem.yaml create mode 100644 sentences/es/person_HassGetState.yaml create mode 100644 sentences/es/todo_HassListAddItem.yaml create mode 100644 sentences/es/weather_HassGetWeather.yaml create mode 100644 tests/es/person_HassGetState.yaml create mode 100644 tests/es/todo_HassListAddItem.yaml create mode 100644 tests/es/weather_HassGetWeather.yaml diff --git a/responses/es/HassGetState.yaml b/responses/es/HassGetState.yaml index cf419bdd04..7b4601b175 100644 --- a/responses/es/HassGetState.yaml +++ b/responses/es/HassGetState.yaml @@ -17,7 +17,11 @@ responses: {% if query.matched %} Sí {% else %} - No, su estado es {{ state.state_with_unit }} + {% if state.domain == "person" %} + No, está en {{ state.state_with_unit }} + {% else %} + No, su estado es {{ state.state_with_unit }} + {% endif %} {% endif %} any: | @@ -27,7 +31,11 @@ responses: Sí, {{ match[:3] | join(", ") }} y otros {{ (match | length - 3) }} dispositivos más {%- else -%} {% if match | length == 1 %} - Sí, el dispositivo {{ match|first }} + {% if state.domain == "person" %} + Sí, {{ match|first }} + {% else %} + Sí, el dispositivo {{ match|first }} + {% endif %} {% else %} Sí, {% for name in match -%} @@ -46,17 +54,29 @@ responses: {% else %} {% set no_match = query.unmatched | map(attribute="name") | sort | list %} {% if no_match | length > 4 %} - No, ni {{ no_match[:3] | join(", ni ") }} ni otros {{ (no_match | length - 3) }} dispositivos tienen ese estado + {% if state.domain == "person" %} + No, ni {{ no_match[:3] | join(", ni ") }} ni otros {{ (no_match | length - 3) }} están en {{slots.state}} + {% else %} + No, ni {{ no_match[:3] | join(", ni ") }} ni otros {{ (no_match | length - 3) }} dispositivos tienen ese estado + {% endif %} {% else %} {% if no_match | length == 1 %} - No, el dispositivo {{ no_match|first }} no tiene ese estado + {% if state.domain == "person" %} + No, {{ no_match|first }} no está en {{slots.state}} + {% else %} + No, el dispositivo {{ no_match|first }} no tiene ese estado + {% endif %} {%- else -%} No, ni {% for name in no_match -%} {% if not loop.first and not loop.last %}, ni {% elif loop.last and not loop.first %} ni {% endif -%} {{ name }} {%- endfor %} - tienen el estado {{slots.state}} + {% if state.domain == "person" %} + están en {{slots.state}} + {% else %} + tienen el estado {{slots.state}} + {% endif %} {% endif %} {% endif %} {% endif %} @@ -78,3 +98,10 @@ responses: how_many: | {{ query.matched | length }} + + where: | + {% if state == "not_home" %} + {{ slots.name | capitalize }} está fuera + {% else %} + {{ slots.name | capitalize }} está en {{ state.state }} + {% endif %} diff --git a/responses/es/HassGetWeather.yaml b/responses/es/HassGetWeather.yaml new file mode 100644 index 0000000000..689207bfce --- /dev/null +++ b/responses/es/HassGetWeather.yaml @@ -0,0 +1,24 @@ +language: es +responses: + intents: + HassGetWeather: + default: > + {% set weather_condition = { + 'clear': 'Cielo despejado', + 'clear-night': 'Cielo despejado', + 'cloudy': 'Cielo nuboso', + 'exceptional': 'Clima excepcionalmente adverso', + 'fog': 'Niebla', + 'hail': 'Precipitaciones en forma de granizo', + 'lightning': 'Tormentas eléctricas', + 'lightning-rainy': 'Lluvia y tormenta eléctrica', + 'partlycloudy': 'Cielos parcialmente nublados', + 'pouring': 'Lluvia copiosa', + 'rainy': 'Lluvia', + 'snowy': 'Precipitaciones en forma de nieve', + 'snowy-rainy': 'Precipitaciones en forma de aguanieve', + 'sunny': 'Sol', + 'windy': 'Vientos', + 'windy-variant': 'Vientos y nubes' + } %} + {{ weather_condition.get((state.state | string).lower(), "") }}, con una temperatura de {{ state.attributes.get('temperature') }} {{ state.attributes.get('temperature_unit') }} diff --git a/responses/es/HassListAddItem.yaml b/responses/es/HassListAddItem.yaml new file mode 100644 index 0000000000..6a8d6785f9 --- /dev/null +++ b/responses/es/HassListAddItem.yaml @@ -0,0 +1,5 @@ +language: "es" +responses: + intents: + HassListAddItem: + item_added: "Se añadió {{ slots.item }}" diff --git a/sentences/es/_common.yaml b/sentences/es/_common.yaml index 708cbc17a9..d46b36e277 100644 --- a/sentences/es/_common.yaml +++ b/sentences/es/_common.yaml @@ -300,6 +300,9 @@ lists: shopping_list_item: wildcard: true + zone: + wildcard: true + expansion_rules: abre: "(abr(a|e|ir|í)|sub(a|e|ir|í))" ahora: "[ahora [mismo]|actualmente|en este momento]" @@ -313,6 +316,7 @@ expansion_rules: cual_es: "(Cuál es [el|la]|Cuáles son [los|las])" dime: "(sab(es|é)|dime|dec(ir|í|id)[me]|ind(i|í)(ca|que|car|cá)[me])" dime_si: " si" + donde_se_encuentra: "dónde " enciende: "(enc[i]end(a|e|er|é)|conect(a|e|ar|á)|activ(a|e|ar|á)|prend(a|e|er|é))" ejecuta: "(|ejecut(a|e|ar|á)|inici(a|e|ar|á))" establece: "(pon[ga|er|é]|estable[z]c(a|e|er|é)|ajust(a|e|ar|á)|configur(a|e|ar|á))" @@ -320,6 +324,7 @@ expansion_rules: mide: "[que] ([es|está] (mid(e|ie)|medi|indica|marca)[ndo|d(a|o)]|tiene|hay) [por|en]" name: "[el|la|los|las] {name}" puerta: "[el|la] (puerta|portón|cancela|verja|reja|compuerta|portillo)" + se_encuentra: (se (encuentra|localiza|ubica)|está|mora) temp: "[el|la] (temperatura|calor|grados)" temperature: "{temperature} [grados] [{temperature_unit}]" diff --git a/sentences/es/light_HassTurnOff.yaml b/sentences/es/light_HassTurnOff.yaml index 63107aab0d..dda0567707 100644 --- a/sentences/es/light_HassTurnOff.yaml +++ b/sentences/es/light_HassTurnOff.yaml @@ -19,5 +19,13 @@ intents: response: "light_all" slots: domain: "light" - area: "all" name: "all" + + # Turn off all lights in the same area as a satellite device + - sentences: + - " ((la luz|las luces)[[ de] aquí]|todas las luces [de ]aquí)" + response: "lights_area" + slots: + domain: "light" + requires_context: + area: null diff --git a/sentences/es/light_HassTurnOn.yaml b/sentences/es/light_HassTurnOn.yaml index 212cc62846..38ee7264e9 100644 --- a/sentences/es/light_HassTurnOn.yaml +++ b/sentences/es/light_HassTurnOn.yaml @@ -11,3 +11,11 @@ intents: slots: domain: "light" response: "lights_area" + # Turn on all lights in the same area as a satellite device + - sentences: + - " ((la luz|las luces)[[ de] aquí]|todas las luces [de ]aquí)" + response: "lights_area" + slots: + domain: "light" + requires_context: + area: null diff --git a/sentences/es/lock_HassGetState.yaml b/sentences/es/lock_HassGetState.yaml index 8da46453f5..89f0c4fc3e 100644 --- a/sentences/es/lock_HassGetState.yaml +++ b/sentences/es/lock_HassGetState.yaml @@ -13,6 +13,7 @@ intents: - sentences: - "(está[n]|hay) alg(ún|una)[s] (cierre|cerradura|pestillo|puerta)[s] {lock_states:state}[ ]" + - "(está[n]|hay) {lock_states:state} alg(ún|una)[s] (cierre|cerradura|pestillo|puerta)[s][ ]" response: any slots: domain: lock diff --git a/sentences/es/lock_HassTurnOff.yaml b/sentences/es/lock_HassTurnOff.yaml index c8b4e41fe7..7ce7de3d13 100644 --- a/sentences/es/lock_HassTurnOff.yaml +++ b/sentences/es/lock_HassTurnOff.yaml @@ -3,15 +3,15 @@ intents: HassTurnOff: data: - sentences: - - "abrir [(cerradura|cerrojo|candado|llave|cierre|puerta) [de]] [ ]" - - "quitar (cerradura|cerrojo|candado|llave|cierre) [de] [ ]" + - "abrir [el|la[s]|los] [(cerradura|cerrojo|candado|llave|cierre|puerta)[s] [de]] [ ]" + - "quitar [el|la[s]|los] (cerradura|cerrojo|candado|llave|cierre)[s] [en|de] [ ]" requires_context: domain: lock response: lock - sentences: - - "abrir [todas|todos] [los|las] (cierres|cerraduras|cerrojos|candados|llaves|puertas) [de puerta[s]] " - - "quitar [todas|todos] [los|las] (cierres|cerraduras|cerrojos|candados|llaves) [de puerta[s]] " + - "abrir [todas|todos] [los|las] (cierres|cerraduras|cerrojos|candados|llaves|puertas) [de [la[s]] puerta[s]] " + - "quitar [todas|todos] [los|las] (cierres|cerraduras|cerrojos|candados|llaves) [de [la[s]] puerta[s]] " slots: domain: "lock" name: "all" diff --git a/sentences/es/lock_HassTurnOn.yaml b/sentences/es/lock_HassTurnOn.yaml index 693113548e..c784f5dabc 100644 --- a/sentences/es/lock_HassTurnOn.yaml +++ b/sentences/es/lock_HassTurnOn.yaml @@ -3,15 +3,15 @@ intents: HassTurnOn: data: - sentences: - - "cerrar con (llave|cerrojo|pestillo|cerradura|candado|cierre) [ ]" - - "echar (la llave|el cerrojo|el pestillo|la cerradura|el candado|el cierre) en [ ]" + - "cerrar [con|el|la[s]|los] (llave|cerrojo|pestillo|cerradura|candado|cierre)[s] [de] [ ]" + - "echar [el|la[s]|los] (llave|cerrojo|pestillo|cerradura|candado|cierre)[s] (en|de) [ ]" requires_context: domain: lock response: lock - sentences: - - "cerrar con (llave|cerrojo|pestillo|cerradura|candado|cierre) [tod(o|a)s] [los|las] [cerraduras|cerrojos|pestillos|puertas] " - - "echar (la llave|el cerrojo|el pestillo|la cerradura|el candado|el cierre ) en [tod(o|a)s] [los|las] [cerraduras|cerrojos|pestillos|puertas] " + - "cerrar [con (llave|cerrojo|pestillo|cerradura|candado|cierre)] [tod(o|a)s] [los|las] [cerraduras|cerrojos|pestillos|puertas|cierres] " + - "echar [el|la[s]|los] (llave|cerrojo|pestillo|cerradura|candado|cierre)[s] en [tod(o|a)s] [los|las] [cerraduras|cerrojos|pestillos|puertas|cierres] " - "echar [tod(o|a)s] [los|las] (llaves|cerrojos|pestillos|cerraduras|candados|cierres) " slots: domain: "lock" diff --git a/sentences/es/person_HassGetState.yaml b/sentences/es/person_HassGetState.yaml new file mode 100644 index 0000000000..4a4120dc10 --- /dev/null +++ b/sentences/es/person_HassGetState.yaml @@ -0,0 +1,44 @@ +language: es +intents: + HassGetState: + data: + # https://www.home-assistant.io/integrations/person/ + - sentences: + - "[ ] " + response: where + requires_context: + domain: person + slots: + domain: person + + - sentences: + - "[ ] [en] [el|la[s]|los] {zone:state}" + response: one_yesno + requires_context: + domain: person + slots: + domain: person + + - sentences: + - "[ ](|hay) alguien [en] [el|la[s]|los] {zone:state}" + response: any + slots: + domain: person + + - sentences: + - "[ ][n] (todos|todo el mundo) [en] [el|la[s]|los] {zone:state}" + response: all + slots: + domain: person + + - sentences: + - "[ ]quién[es] [n] [en] [el|la[s]|los] {zone:state}" + response: which + slots: + domain: person + + - sentences: + - "[ ]cuánta[s] (gente|personas) (hay|[n]) [en] [el|la[s]|los] {zone:state}" + response: how_many + slots: + domain: person diff --git a/sentences/es/todo_HassListAddItem.yaml b/sentences/es/todo_HassListAddItem.yaml new file mode 100644 index 0000000000..a3411e2ebd --- /dev/null +++ b/sentences/es/todo_HassListAddItem.yaml @@ -0,0 +1,12 @@ +language: "es" +intents: + HassListAddItem: + data: + - sentences: + - (a|en) [[mi|el] lista[do] [de|del|de la[s]|de los]] {name} + - (a|en) [[mi|el|la] lista[do] [de|del|de la[s]|de los]] {name} + response: item_added + requires_context: + domain: todo + expansion_rules: + item: "{shopping_list_item:item}" diff --git a/sentences/es/weather_HassGetWeather.yaml b/sentences/es/weather_HassGetWeather.yaml new file mode 100644 index 0000000000..692d59bb44 --- /dev/null +++ b/sentences/es/weather_HassGetWeather.yaml @@ -0,0 +1,8 @@ +language: es +intents: + HassGetWeather: + data: + - sentences: + - "qué tiempo hace [en ]" + requires_context: + domain: weather diff --git a/tests/es/_fixtures.yaml b/tests/es/_fixtures.yaml index de1f10e265..9f15fb23c8 100644 --- a/tests/es/_fixtures.yaml +++ b/tests/es/_fixtures.yaml @@ -706,3 +706,33 @@ entities: attributes: device_class: wind_speed unit_of_measurement: "km/h" + + - name: "Madrid" + id: "weather.madrid" + state: "rainy" + attributes: + temperature: "18" + temperature_unit: "°C" + + - name: "Ávila" + id: "weather.avila" + state: "clear" + attributes: + temperature: "-4" + temperature_unit: "°C" + + - name: "José" + id: "person.jose" + state: "casa" + + - name: "Ada" + id: "person.ada" + state: "Trabajo" + + - name: "Juan" + id: "person.john" + state: "not_home" + + - name: "Mercadona" + id: "todo.mercadona" + state: "" diff --git a/tests/es/light_HassTurnOff.yaml b/tests/es/light_HassTurnOff.yaml index e935f2c546..4f7555fe74 100644 --- a/tests/es/light_HassTurnOff.yaml +++ b/tests/es/light_HassTurnOff.yaml @@ -33,3 +33,15 @@ tests: area: Dormitorio domain: light response: Luces apagadas + + - sentences: + - "apaga la luz" + - "apaga las luces de aquí" + - "apaga todas las luces aquí" + intent: + name: HassTurnOff + context: + area: Salón + slots: + domain: light + response: "Luces apagadas" diff --git a/tests/es/light_HassTurnOn.yaml b/tests/es/light_HassTurnOn.yaml index ec8010121c..f6fbf698b7 100644 --- a/tests/es/light_HassTurnOn.yaml +++ b/tests/es/light_HassTurnOn.yaml @@ -34,3 +34,17 @@ tests: area: Dormitorio domain: light response: Luces encendidas + + - sentences: + - prender las luces + - enciende todas las luces de aquí + - podrías encender la luz + - conecta las luces + - puedes activar las luces aquí + intent: + name: HassTurnOn + context: + area: Salón + slots: + domain: light + response: Luces encendidas diff --git a/tests/es/lock_HassGetState.yaml b/tests/es/lock_HassGetState.yaml index 175ab2cb86..c08977f659 100644 --- a/tests/es/lock_HassGetState.yaml +++ b/tests/es/lock_HassGetState.yaml @@ -13,6 +13,7 @@ tests: - sentences: - "¿hay alguna cerradura abierta?" + - "¿hay abierta alguna cerradura?" intent: name: HassGetState slots: diff --git a/tests/es/lock_HassTurnOff.yaml b/tests/es/lock_HassTurnOff.yaml index dacab3ea3c..542e882f55 100644 --- a/tests/es/lock_HassTurnOff.yaml +++ b/tests/es/lock_HassTurnOff.yaml @@ -14,6 +14,8 @@ tests: - "abrir todos los cerrojos de la cocina" - "abrir cierres de puertas de la cocina" - "quitar cerrojos de la cocina" + - "abrir cerraduras de la cocina" + - "quitar todos los cierres de la puerta de la cocina" intent: name: HassTurnOff slots: diff --git a/tests/es/person_HassGetState.yaml b/tests/es/person_HassGetState.yaml new file mode 100644 index 0000000000..2a4e804a7c --- /dev/null +++ b/tests/es/person_HassGetState.yaml @@ -0,0 +1,66 @@ +language: es +tests: + - sentences: + - "dónde está José" + intent: + name: HassGetState + slots: + domain: person + name: José + response: "José está en casa" + + - sentences: + - "dónde está Ada" + intent: + name: HassGetState + slots: + domain: person + name: Ada + response: "Ada está en Trabajo" + + - sentences: + - "está Ada en casa" + intent: + name: HassGetState + slots: + domain: person + name: Ada + state: casa + response: "No, está en Trabajo" + + - sentences: + - "hay alguien en casa" + intent: + name: HassGetState + slots: + domain: person + state: casa + response: "Sí, José" + + - sentences: + - "está todo el mundo en casa" + - "están todos en casa" + intent: + name: HassGetState + slots: + domain: person + state: casa + response: "No, ni Ada ni Juan están en casa" + + - sentences: + - "quién está en casa" + intent: + name: HassGetState + slots: + domain: person + state: casa + response: "José" + + - sentences: + - "cuánta gente hay en casa" + intent: + name: HassGetState + slots: + domain: person + state: casa + response: "1" diff --git a/tests/es/todo_HassListAddItem.yaml b/tests/es/todo_HassListAddItem.yaml new file mode 100644 index 0000000000..9df2aade9b --- /dev/null +++ b/tests/es/todo_HassListAddItem.yaml @@ -0,0 +1,24 @@ +language: es +tests: + - sentences: + - añade manzanas a mi lista de Mercadona + - añadir manzanas a Mercadona + - añadí manzanas a lista Mercadona + - añadir manzanas en el listado Mercadona + - pon manzanas en el lista del Mercadona + intent: + name: HassListAddItem + slots: + item: "manzanas " + name: "Mercadona" + response: Se añadió manzanas + + - sentences: + - añada en la lista Mercadona manzanas + - pon en la lista del Mercadona manzanas + intent: + name: HassListAddItem + slots: + item: "manzanas" + name: "Mercadona" + response: Se añadió manzanas diff --git a/tests/es/weather_HassGetWeather.yaml b/tests/es/weather_HassGetWeather.yaml new file mode 100644 index 0000000000..ab5cd2416c --- /dev/null +++ b/tests/es/weather_HassGetWeather.yaml @@ -0,0 +1,17 @@ +language: es +tests: + - sentences: + - "qué tiempo hace en Madrid" + intent: + name: HassGetWeather + slots: + name: Madrid + response: Lluvia, con una temperatura de 18 °C + + - sentences: + - "qué tiempo hace en Ávila" + intent: + name: HassGetWeather + slots: + name: Ávila + response: Cielo despejado, con una temperatura de -4 °C From 2a138f0e5ddcd5ea43fd34e156169200a66d2dca Mon Sep 17 00:00:00 2001 From: Tudor Sandu Date: Wed, 15 Nov 2023 00:03:37 -0800 Subject: [PATCH 6/7] [RO] Add person_HassGetState (#1643) * Add person_HassGetState --- responses/ro/HassGetState.yaml | 9 ++ sentences/ro/_common.yaml | 4 + sentences/ro/person_HassGetState.yaml | 81 +++++++++++++++++ tests/ro/_fixtures.yaml | 12 +++ tests/ro/person_HassGetState.yaml | 125 ++++++++++++++++++++++++++ 5 files changed, 231 insertions(+) create mode 100644 sentences/ro/person_HassGetState.yaml create mode 100644 tests/ro/person_HassGetState.yaml diff --git a/responses/ro/HassGetState.yaml b/responses/ro/HassGetState.yaml index f5c3cf6b9a..4d06989aa0 100644 --- a/responses/ro/HassGetState.yaml +++ b/responses/ro/HassGetState.yaml @@ -64,3 +64,12 @@ responses: how_many: | {{ query.matched | length }} + + where: | + {% if state.state == "not_home" %} + {{ slots.name | capitalize }} nu este acasă + {% elif state.state == "home" %} + {{ slots.name | capitalize }} este acasă + {% else %} + {{ slots.name | capitalize }} este la {{ state.state }} + {% endif %} diff --git a/sentences/ro/_common.yaml b/sentences/ro/_common.yaml index 16e3f6b7cd..1eac587bd4 100644 --- a/sentences/ro/_common.yaml +++ b/sentences/ro/_common.yaml @@ -430,6 +430,9 @@ lists: shopping_list_item: wildcard: true + zone: + wildcard: true + expansion_rules: # Placeholders area: "[(zona | regiunea | spa(ț|t)iul)] {area}" @@ -472,6 +475,7 @@ expansion_rules: # Prepositions in: "((î|i)n)" din: "(din | (î|i)n | pentru | [de] la | [de] pe | de)" # used particularly for areas + la: "(la | (î|i)n)" # used particularly for zones # Adjectives pornit: "(pornit[(ă|a)] | deschis[(ă|a)]) | aprins[(ă|a)] | activat[(ă|a)]" diff --git a/sentences/ro/person_HassGetState.yaml b/sentences/ro/person_HassGetState.yaml new file mode 100644 index 0000000000..15fd900326 --- /dev/null +++ b/sentences/ro/person_HassGetState.yaml @@ -0,0 +1,81 @@ +language: ro +intents: + HassGetState: + data: + # https://www.home-assistant.io/integrations/person/ + - sentences: + - "unde " + - "unde-i " + response: where + requires_context: + domain: person + slots: + domain: person + + - sentences: + - "(; acas(ă|a))" + response: one_yesno + requires_context: + domain: person + slots: + domain: person + state: home + - sentences: + - "(; [] {zone:state})" + response: one_yesno + requires_context: + domain: person + slots: + domain: person + + - sentences: + - " cineva acas(ă|a)" + response: any + slots: + domain: person + state: home + - sentences: + - " cineva [] {zone:state}" + response: any + slots: + domain: person + + - sentences: + - " (acas(ă|a);toat(ă|a) lumea)" + - "toat(ă|a) lumea acas(ă|a)" + - "sunt[em] (acas(ă|a);(to(ț|t)i|cu to(ț|t)ii))" + response: all + slots: + domain: person + state: home + - sentences: + - " ([] {zone:state};toat(ă|a) lumea)" + - "toat(ă|a) lumea [] {zone:state}" + - "sunt[em] ([] {zone:state};(to(ț|t)i|cu to(ț|t)ii))" + response: all + slots: + domain: person + + - sentences: + - "cine acas(ă|a)" + response: which + slots: + domain: person + state: home + - sentences: + - "cine [] {zone:state}" + response: which + slots: + domain: person + + - sentences: + - " (persoane|oameni) sunt acas(ă|a)" + response: how_many + slots: + domain: person + state: home + - sentences: + - " (persoane|oameni) sunt [] {zone:state}" + response: how_many + slots: + domain: person diff --git a/tests/ro/_fixtures.yaml b/tests/ro/_fixtures.yaml index 813f9a22bf..5f6908e648 100644 --- a/tests/ro/_fixtures.yaml +++ b/tests/ro/_fixtures.yaml @@ -376,3 +376,15 @@ entities: attributes: temperature: "22" temperature_unit: "°C" + + - name: "Mihai" + id: "person.mihai" + state: "home" + + - name: "Cristina" + id: "person.cristina" + state: "magazin" + + - name: "Claudiu" + id: "person.claudiu" + state: "not_home" diff --git a/tests/ro/person_HassGetState.yaml b/tests/ro/person_HassGetState.yaml new file mode 100644 index 0000000000..80f95a2bb4 --- /dev/null +++ b/tests/ro/person_HassGetState.yaml @@ -0,0 +1,125 @@ +language: ro +tests: + - sentences: + - "unde e Mihai?" + intent: + name: HassGetState + slots: + domain: person + name: Mihai + response: "Mihai este acasă" + + - sentences: + - "unde este Cristina" + - "unde-i Cristina" + intent: + name: HassGetState + slots: + domain: person + name: Cristina + response: "Cristina este la magazin" + + - sentences: + - "unde este Claudiu?" + intent: + name: HassGetState + slots: + domain: person + name: Claudiu + response: "Claudiu nu este acasă" + + - sentences: + - "este acasa Cristina?" + intent: + name: HassGetState + slots: + domain: person + name: Cristina + state: home + response: "Nu, ci magazin" + + - sentences: + - "Cristina este la magazin" + intent: + name: HassGetState + slots: + domain: person + name: Cristina + state: magazin + response: "Da" + + - sentences: + - "este cineva acasa" + intent: + name: HassGetState + slots: + domain: person + state: home + response: "Da, Mihai" + + - sentences: + - "este cineva la magazin" + intent: + name: HassGetState + slots: + domain: person + state: magazin + response: "Da, Cristina" + + - sentences: + - "este toata lumea acasa" + - "toata lumea este acasa" + - "suntem toti acasa" + intent: + name: HassGetState + slots: + domain: person + state: home + response: "Nu, Claudiu și Cristina nu sunt" + + - sentences: + - "este toata lumea la magazin" + - "toata lumea e la magazin" + - "suntem cu totii la magazin" + intent: + name: HassGetState + slots: + domain: person + state: magazin + response: "Nu, Claudiu și Mihai nu sunt" + + - sentences: + - "cine este acasa" + intent: + name: HassGetState + slots: + domain: person + state: home + response: "Mihai" + + - sentences: + - "cine este la magazin" + intent: + name: HassGetState + slots: + domain: person + state: magazin + response: "Cristina" + + - sentences: + - "cati oameni sunt acasa" + intent: + name: HassGetState + slots: + domain: person + state: home + response: "1" + + - sentences: + - "cate persoane sunt la magazin" + intent: + name: HassGetState + slots: + domain: person + state: magazin + response: "1" From 984557ce766705074bd337d9adc73e537fe4bb58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mar=C3=ADn?= <292309+davefx@users.noreply.github.com> Date: Thu, 16 Nov 2023 15:58:32 +0100 Subject: [PATCH 7/7] [es] fix lock/door confussion (#1648) * [es] Fixing lock-door-window confussion in Spanish --- sentences/es/lock_HassGetState.yaml | 13 ++++++++----- sentences/es/lock_HassTurnOff.yaml | 6 +++--- sentences/es/lock_HassTurnOn.yaml | 5 +++-- sentences/es/person_HassGetState.yaml | 2 +- tests/es/lock_HassGetState.yaml | 3 +++ tests/es/lock_HassTurnOn.yaml | 1 + 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/sentences/es/lock_HassGetState.yaml b/sentences/es/lock_HassGetState.yaml index 89f0c4fc3e..6b9f3493c5 100644 --- a/sentences/es/lock_HassGetState.yaml +++ b/sentences/es/lock_HassGetState.yaml @@ -12,26 +12,29 @@ intents: domain: lock - sentences: - - "(está[n]|hay) alg(ún|una)[s] (cierre|cerradura|pestillo|puerta)[s] {lock_states:state}[ ]" - - "(está[n]|hay) {lock_states:state} alg(ún|una)[s] (cierre|cerradura|pestillo|puerta)[s][ ]" + - "(está[n]|hay) alg(ún|una)[s] (cierre|cerradura|pestillo|cerrojo|llave)[s] {lock_states:state}[ ]" + - "(está[n]|hay) {lock_states:state} alg(ún|una)[s] (cierre|cerradura|pestillo|cerrojo|llave)[s][ ]" response: any slots: domain: lock - sentences: - - "están todas l(o|a)s (cierres|cerraduras|pestillos|puertas) {lock_states:state}[ ]" + - "están tod(o|a)s l(o|a)s (cierres|cerraduras|pestillos|cerrojos|llaves) {lock_states:state}[ ]" + - "están todas l(o|a)s (puertas|ventanas) {lock_states:state} [con] (cierre|pestillo|cerrojo|cerradura|llave)[ ]" response: all slots: domain: lock - sentences: - - "(qué|cual[es]) puerta[s] está[n] {lock_states:state}[ ]" + - "(qué|cual[es]) (cierre|cerradura|pestillo|cerrojo|llave)[s] está[n] {lock_states:state}[ ]" + - "(qué|cual[es]) (puerta|ventana)[s] está[n] {lock_states:state} [con] (cierre|pestillo|cerrojo|cerradura|llave)[ ]" response: which slots: domain: lock - sentences: - - "cuánt(o|a)s (puertas|cierres|cerraduras|pestillos) (están|hay) {lock_states:state}[ ]" + - "cuánt(o|a)s (cierres|cerraduras|pestillos|cerrojos|llaves) (están|hay) {lock_states:state}[ ]" + - "cuánt(o|a)s (puertas|ventanas) (están|hay) {lock_states:state} [con] (cierre|pestillo|cerrojo|cerradura|llave)[ ]" response: how_many slots: domain: lock diff --git a/sentences/es/lock_HassTurnOff.yaml b/sentences/es/lock_HassTurnOff.yaml index 7ce7de3d13..f67fc1fb2c 100644 --- a/sentences/es/lock_HassTurnOff.yaml +++ b/sentences/es/lock_HassTurnOff.yaml @@ -3,15 +3,15 @@ intents: HassTurnOff: data: - sentences: - - "abrir [el|la[s]|los] [(cerradura|cerrojo|candado|llave|cierre|puerta)[s] [de]] [ ]" + - "abrir [el|la[s]|los] [(cerradura|cerrojo|candado|llave|cierre)[s] [de]] [ ]" - "quitar [el|la[s]|los] (cerradura|cerrojo|candado|llave|cierre)[s] [en|de] [ ]" requires_context: domain: lock response: lock - sentences: - - "abrir [todas|todos] [los|las] (cierres|cerraduras|cerrojos|candados|llaves|puertas) [de [la[s]] puerta[s]] " - - "quitar [todas|todos] [los|las] (cierres|cerraduras|cerrojos|candados|llaves) [de [la[s]] puerta[s]] " + - "abrir [todas|todos] [los|las] (cierres|cerraduras|cerrojos|candados|llaves) [de [la[s]] (puerta|ventana)[s]] " + - "quitar [todas|todos] [los|las] (cierres|cerraduras|cerrojos|candados|llaves) [de [la[s]] (puerta|venana)[s]] " slots: domain: "lock" name: "all" diff --git a/sentences/es/lock_HassTurnOn.yaml b/sentences/es/lock_HassTurnOn.yaml index c784f5dabc..db6bc398d7 100644 --- a/sentences/es/lock_HassTurnOn.yaml +++ b/sentences/es/lock_HassTurnOn.yaml @@ -10,8 +10,9 @@ intents: response: lock - sentences: - - "cerrar [con (llave|cerrojo|pestillo|cerradura|candado|cierre)] [tod(o|a)s] [los|las] [cerraduras|cerrojos|pestillos|puertas|cierres] " - - "echar [el|la[s]|los] (llave|cerrojo|pestillo|cerradura|candado|cierre)[s] en [tod(o|a)s] [los|las] [cerraduras|cerrojos|pestillos|puertas|cierres] " + - "cerrar [con (llave|cerrojo|pestillo|cerradura|candado|cierre)] [tod(o|a)s] [los|las] [cerraduras|cerrojos|pestillos|cierres] " + - "cerrar con (llave|cerrojo|pestillo|cerradura|candado|cierre) [tod(o|a)s] [los|las] [puertas|ventanas] " + - "echar [el|la[s]|los] (llave|cerrojo|pestillo|cerradura|candado|cierre)[s] en [tod(o|a)s] [los|las] [cerraduras|cerrojos|pestillos|cierres|puertas|ventanas] " - "echar [tod(o|a)s] [los|las] (llaves|cerrojos|pestillos|cerraduras|candados|cierres) " slots: domain: "lock" diff --git a/sentences/es/person_HassGetState.yaml b/sentences/es/person_HassGetState.yaml index 4a4120dc10..d40d6ce136 100644 --- a/sentences/es/person_HassGetState.yaml +++ b/sentences/es/person_HassGetState.yaml @@ -26,7 +26,7 @@ intents: domain: person - sentences: - - "[ ][n] (todos|todo el mundo) [en] [el|la[s]|los] {zone:state}" + - "[ ][n] (todos|todo el mundo) en [el|la[s]|los] {zone:state}" response: all slots: domain: person diff --git a/tests/es/lock_HassGetState.yaml b/tests/es/lock_HassGetState.yaml index c08977f659..fd5f361030 100644 --- a/tests/es/lock_HassGetState.yaml +++ b/tests/es/lock_HassGetState.yaml @@ -23,6 +23,7 @@ tests: - sentences: - "¿Están todas las puertas cerradas con pestillo?" + - "¿Están todos los cerrojos cerrados?" intent: name: HassGetState slots: @@ -32,6 +33,7 @@ tests: - sentences: - "¿Qué puertas están cerradas con cerrojo?" + - "¿Qué pestillos están cerrados?" intent: name: HassGetState slots: @@ -41,6 +43,7 @@ tests: - sentences: - "¿cuántos pestillos hay echados?" + - "¿cuántos puertas hay cerradas con llave?" intent: name: HassGetState slots: diff --git a/tests/es/lock_HassTurnOn.yaml b/tests/es/lock_HassTurnOn.yaml index a033d291e5..2f84284816 100644 --- a/tests/es/lock_HassTurnOn.yaml +++ b/tests/es/lock_HassTurnOn.yaml @@ -13,6 +13,7 @@ tests: - sentences: - "echar todos los pestillos de la cocina" + - "echar la llave en todas las puertas de la cocina" - "cerrar con cerrojo puertas de la cocina" - "cerrar con cerradura las puertas de la cocina" intent: