From fbd8eb516be5660c5e76579208ede400566ccba3 Mon Sep 17 00:00:00 2001 From: slegars56 <91634650+slegars56@users.noreply.github.com> Date: Mon, 26 Feb 2024 12:29:34 +0100 Subject: [PATCH] [Fr] Add new intents for cover, valve, vacuum, media player (#1973) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Fr] Add new intents for cover, valve, vacuum, media player I had to exclude the vacuum domain in homeassistant_HassTurnOff and homeassistant_HassTurnOn, not sure about the impact of that change. * Roll back on test/en/media_player_HassMediaNext.yaml * Update media_player_HassMediaNext.yaml * [Fr] HassMediaPause.yaml Changed response and test of HassMediaPause.yaml --> replace "Pause" with "Lecture en pause" * [Fr] Reviewed responses and removed expansion_rules Removed and expansion rules Updated tests accordingly use , and in sentences * [Fr] Update HassMediaNext Update the response: Suivant --> Média suivant Add an expansion_rule with media types (chanson, film...) * [Fr] Reviewed verbs in new intents New expansion rules for handling infinitive form of verbs In the expansion_rule , I added a nominal form of verbs (lecture, reprise) as they can be used as orders with media players (For example: "Lecture sur la TV" ) Note: I also sorted the expansion rules that was in the questions category * [Fr] fix HassVacuumReturnToBase verb + response update Use the expansion_rule Update responses for HassVacuumStart : "démarré" --> "Nettoyage démarré and HassMediaUnpause "Reprise" --> "Lecture relancée" * [Fr] adjustments on media_player_Hass... - sentences/fr/_common: split verbs "lire" and "reprendre". add "média" value in expansion_rule - sentences/fr/media_player_HassUnpause: add an intent to cover "Reprends/reprendre la lecture sur [...]" - sentences/fr/media_player_HassSetVolume : Deleted unuseful spaces in intent - test/fr/media_player_HassMediaUnpause: add a test for covering all intents --- responses/fr/HassMediaNext.yaml | 5 ++++ responses/fr/HassMediaPause.yaml | 5 ++++ responses/fr/HassMediaUnpause.yaml | 5 ++++ responses/fr/HassSetPosition.yaml | 5 ++++ responses/fr/HassSetVolume.yaml | 5 ++++ responses/fr/HassTurnOff.yaml | 1 + responses/fr/HassTurnOn.yaml | 1 + responses/fr/HassVacuumReturnToBase.yaml | 5 ++++ responses/fr/HassVacuumStart.yaml | 5 ++++ sentences/fr/_common.yaml | 22 ++++++++++++++-- .../fr/homeassistant_HassSetPosition.yaml | 11 ++++++++ sentences/fr/homeassistant_HassTurnOff.yaml | 2 ++ sentences/fr/homeassistant_HassTurnOn.yaml | 2 ++ sentences/fr/media_player_HassMediaNext.yaml | 9 +++++++ sentences/fr/media_player_HassMediaPause.yaml | 9 +++++++ .../fr/media_player_HassMediaUnpause.yaml | 9 +++++++ sentences/fr/media_player_HassSetVolume.yaml | 8 ++++++ .../fr/vacuum_HassVacuumReturnToBase.yaml | 8 ++++++ sentences/fr/vacuum_HassVacuumStart.yaml | 8 ++++++ sentences/fr/valve_HassTurnOff.yaml | 11 ++++++++ sentences/fr/valve_HassTurnOn.yaml | 11 ++++++++ tests/fr/_fixtures.yaml | 17 ++++++++++++ tests/fr/homeassistant_HassSetPosition.yaml | 26 +++++++++++++++++++ tests/fr/media_player_HassMediaNext.yaml | 23 ++++++++++++++++ tests/fr/media_player_HassMediaPause.yaml | 10 +++++++ tests/fr/media_player_HassMediaUnpause.yaml | 11 ++++++++ tests/fr/media_player_HassSetVolume.yaml | 10 +++++++ tests/fr/vacuum_HassVacuumReturnToBase.yaml | 9 +++++++ tests/fr/vacuum_HassVacuumStart.yaml | 9 +++++++ tests/fr/valve_HassTurnOff.yaml | 10 +++++++ tests/fr/valve_HassTurnOn.yaml | 10 +++++++ 31 files changed, 280 insertions(+), 2 deletions(-) create mode 100644 responses/fr/HassMediaNext.yaml create mode 100644 responses/fr/HassMediaPause.yaml create mode 100644 responses/fr/HassMediaUnpause.yaml create mode 100644 responses/fr/HassSetPosition.yaml create mode 100644 responses/fr/HassSetVolume.yaml create mode 100644 responses/fr/HassVacuumReturnToBase.yaml create mode 100644 responses/fr/HassVacuumStart.yaml create mode 100644 sentences/fr/homeassistant_HassSetPosition.yaml create mode 100644 sentences/fr/media_player_HassMediaNext.yaml create mode 100644 sentences/fr/media_player_HassMediaPause.yaml create mode 100644 sentences/fr/media_player_HassMediaUnpause.yaml create mode 100644 sentences/fr/media_player_HassSetVolume.yaml create mode 100644 sentences/fr/vacuum_HassVacuumReturnToBase.yaml create mode 100644 sentences/fr/vacuum_HassVacuumStart.yaml create mode 100644 sentences/fr/valve_HassTurnOff.yaml create mode 100644 sentences/fr/valve_HassTurnOn.yaml create mode 100644 tests/fr/homeassistant_HassSetPosition.yaml create mode 100644 tests/fr/media_player_HassMediaNext.yaml create mode 100644 tests/fr/media_player_HassMediaPause.yaml create mode 100644 tests/fr/media_player_HassMediaUnpause.yaml create mode 100644 tests/fr/media_player_HassSetVolume.yaml create mode 100644 tests/fr/vacuum_HassVacuumReturnToBase.yaml create mode 100644 tests/fr/vacuum_HassVacuumStart.yaml create mode 100644 tests/fr/valve_HassTurnOff.yaml create mode 100644 tests/fr/valve_HassTurnOn.yaml diff --git a/responses/fr/HassMediaNext.yaml b/responses/fr/HassMediaNext.yaml new file mode 100644 index 0000000000..b521365189 --- /dev/null +++ b/responses/fr/HassMediaNext.yaml @@ -0,0 +1,5 @@ +language: fr +responses: + intents: + HassMediaNext: + default: "Média suivant" diff --git a/responses/fr/HassMediaPause.yaml b/responses/fr/HassMediaPause.yaml new file mode 100644 index 0000000000..567da541b9 --- /dev/null +++ b/responses/fr/HassMediaPause.yaml @@ -0,0 +1,5 @@ +language: fr +responses: + intents: + HassMediaPause: + default: "Lecture en pause" diff --git a/responses/fr/HassMediaUnpause.yaml b/responses/fr/HassMediaUnpause.yaml new file mode 100644 index 0000000000..45e8b544ee --- /dev/null +++ b/responses/fr/HassMediaUnpause.yaml @@ -0,0 +1,5 @@ +language: fr +responses: + intents: + HassMediaUnpause: + default: "Lecture relancée" diff --git a/responses/fr/HassSetPosition.yaml b/responses/fr/HassSetPosition.yaml new file mode 100644 index 0000000000..95bfadf875 --- /dev/null +++ b/responses/fr/HassSetPosition.yaml @@ -0,0 +1,5 @@ +language: fr +responses: + intents: + HassSetPosition: + default: "Position réglée" diff --git a/responses/fr/HassSetVolume.yaml b/responses/fr/HassSetVolume.yaml new file mode 100644 index 0000000000..7f6d120fbd --- /dev/null +++ b/responses/fr/HassSetVolume.yaml @@ -0,0 +1,5 @@ +language: fr +responses: + intents: + HassSetVolume: + default: "Volume réglé" diff --git a/responses/fr/HassTurnOff.yaml b/responses/fr/HassTurnOff.yaml index bb64019e50..49f5e33547 100644 --- a/responses/fr/HassTurnOff.yaml +++ b/responses/fr/HassTurnOff.yaml @@ -6,3 +6,4 @@ responses: fans: "Ventilateurs éteints" cover: "Fermé" lock: "Ouvert" + valve: "Fermé" diff --git a/responses/fr/HassTurnOn.yaml b/responses/fr/HassTurnOn.yaml index 519536e6d7..400b3bf5c3 100644 --- a/responses/fr/HassTurnOn.yaml +++ b/responses/fr/HassTurnOn.yaml @@ -8,3 +8,4 @@ responses: lock: "Fermé" scene: "Activée" script: "Démarré" + valve: "Ouvert" diff --git a/responses/fr/HassVacuumReturnToBase.yaml b/responses/fr/HassVacuumReturnToBase.yaml new file mode 100644 index 0000000000..f26637b5b0 --- /dev/null +++ b/responses/fr/HassVacuumReturnToBase.yaml @@ -0,0 +1,5 @@ +language: fr +responses: + intents: + HassVacuumReturnToBase: + default: "Retour à la base" diff --git a/responses/fr/HassVacuumStart.yaml b/responses/fr/HassVacuumStart.yaml new file mode 100644 index 0000000000..8040d3ce6e --- /dev/null +++ b/responses/fr/HassVacuumStart.yaml @@ -0,0 +1,5 @@ +language: fr +responses: + intents: + HassVacuumStart: + default: "Nettoyage lancé" diff --git a/sentences/fr/_common.yaml b/sentences/fr/_common.yaml index 1ab594086f..12db83d597 100644 --- a/sentences/fr/_common.yaml +++ b/sentences/fr/_common.yaml @@ -497,6 +497,18 @@ lists: zone: wildcard: true + position: + range: + type: "percentage" + from: 0 + to: 100 + + volume: + range: + type: "percentage" + from: 0 + to: 100 + expansion_rules: #Common rules pourcent: "(%| %| pourcent)" @@ -519,7 +531,12 @@ expansion_rules: eteins: "(éteint|eteint|éteins|eteins|éteindre|eteindre|désactive|désactiver|stoppe|stopper|arrête|arrêter|coupe|couper)" ferme: "(ferme|fermer|baisse|baisser)" ouvre: "(ouvre|ouvrir|monte|monter)" - eclaire: (éclaire|éclairer|illumine|illuminer) + eclaire: "(éclaire|éclairer|illumine|illuminer)" + mets: "(mets|mettre|passe|passer)" + renvoie: "(renvoie|renvoyer|arrête|arrêter|stop[pe]|stopper)" + lis: "(lis|lire|lecture)" + reprends: "(reprends|reprendre|reprise)" + demarre: "(démarre|démarrer|lance|lancer)" # Domains and Things lumiere: "(lumière|lampe|ampoule)" @@ -528,13 +545,14 @@ expansion_rules: ventilateurs: "[les ](ventilateurs|brasseurs d'air)" fenetre: "(fenetre[s]|fenêtre[s]|baie[s]|velux|vélux|lucarne[s])" appareil: "(appareil|machine|équipement)[s]" + capteur: "(capteur|sonde|détecteur)[s]" + media: "(morceau|chanson|élément|podcast|film|vidéo|épisode|média)" # Questions yatil: "(y a[-][ ]t[-][']il|il y a)" estil: "(est|sont)[-][ ][(il[s]|elle[s])]" atil: "(ont|a)[-][ ][t][ ][-][(il[s]|elle[s])]" quel: "quel[le][s]" - capteur: "(capteur|sonde|détecteur)[s]" quelest: " (est|sont)" what_is_the_class_of_name: " (le |la |l'|les ) [(indiqué[e][s]|mesuré[e][s]|renvoyé[e][s]|restant[e][s]|retourné[e][s]|utilisé[e][s]|produit[e][s]|consommé[e][s]|donné[e][s]) ][(par||sur)] []{name} [ []{area}]" diff --git a/sentences/fr/homeassistant_HassSetPosition.yaml b/sentences/fr/homeassistant_HassSetPosition.yaml new file mode 100644 index 0000000000..624f03d8ed --- /dev/null +++ b/sentences/fr/homeassistant_HassSetPosition.yaml @@ -0,0 +1,11 @@ +language: fr +intents: + HassSetPosition: + data: + - sentences: + - " [la position de] []{name} à {position}" + - "(|) []{name} à {position}" + requires_context: + domain: + - cover + - valve diff --git a/sentences/fr/homeassistant_HassTurnOff.yaml b/sentences/fr/homeassistant_HassTurnOff.yaml index b3b6345882..ffb0efe2e5 100644 --- a/sentences/fr/homeassistant_HassTurnOff.yaml +++ b/sentences/fr/homeassistant_HassTurnOff.yaml @@ -8,3 +8,5 @@ intents: excludes_context: domain: - cover + - vacuum + - valve diff --git a/sentences/fr/homeassistant_HassTurnOn.yaml b/sentences/fr/homeassistant_HassTurnOn.yaml index 7154768953..2457aacd25 100644 --- a/sentences/fr/homeassistant_HassTurnOn.yaml +++ b/sentences/fr/homeassistant_HassTurnOn.yaml @@ -8,3 +8,5 @@ intents: excludes_context: domain: - cover + - vacuum + - valve diff --git a/sentences/fr/media_player_HassMediaNext.yaml b/sentences/fr/media_player_HassMediaNext.yaml new file mode 100644 index 0000000000..9b7704bfec --- /dev/null +++ b/sentences/fr/media_player_HassMediaNext.yaml @@ -0,0 +1,9 @@ +language: fr +intents: + HassMediaNext: + data: + - sentences: + - " suivant[e] sur []{name}" + - " (|au|à la) suivant[e] [sur] []{name}" + requires_context: + domain: media_player diff --git a/sentences/fr/media_player_HassMediaPause.yaml b/sentences/fr/media_player_HassMediaPause.yaml new file mode 100644 index 0000000000..9a3441653a --- /dev/null +++ b/sentences/fr/media_player_HassMediaPause.yaml @@ -0,0 +1,9 @@ +language: fr +intents: + HassMediaPause: + data: + - sentences: + - " []{name} sur pause" + - "Pause sur []{name}" + requires_context: + domain: media_player diff --git a/sentences/fr/media_player_HassMediaUnpause.yaml b/sentences/fr/media_player_HassMediaUnpause.yaml new file mode 100644 index 0000000000..efd1bc51d8 --- /dev/null +++ b/sentences/fr/media_player_HassMediaUnpause.yaml @@ -0,0 +1,9 @@ +language: fr +intents: + HassMediaUnpause: + data: + - sentences: + - " sur []{name}" + - " [la lecture] sur []{name}" + requires_context: + domain: media_player diff --git a/sentences/fr/media_player_HassSetVolume.yaml b/sentences/fr/media_player_HassSetVolume.yaml new file mode 100644 index 0000000000..d98b8ab1e7 --- /dev/null +++ b/sentences/fr/media_player_HassSetVolume.yaml @@ -0,0 +1,8 @@ +language: fr +intents: + HassSetVolume: + data: + - sentences: + - " [le volume de] []{name} à {volume:volume_level}" + requires_context: + domain: media_player diff --git a/sentences/fr/vacuum_HassVacuumReturnToBase.yaml b/sentences/fr/vacuum_HassVacuumReturnToBase.yaml new file mode 100644 index 0000000000..47dab01c20 --- /dev/null +++ b/sentences/fr/vacuum_HassVacuumReturnToBase.yaml @@ -0,0 +1,8 @@ +language: fr +intents: + HassVacuumReturnToBase: + data: + - sentences: + - " []{name} [(à|sur) (sa|la) base]" + requires_context: + domain: vacuum diff --git a/sentences/fr/vacuum_HassVacuumStart.yaml b/sentences/fr/vacuum_HassVacuumStart.yaml new file mode 100644 index 0000000000..10da40da96 --- /dev/null +++ b/sentences/fr/vacuum_HassVacuumStart.yaml @@ -0,0 +1,8 @@ +language: fr +intents: + HassVacuumStart: + data: + - sentences: + - " []{name}" + requires_context: + domain: vacuum diff --git a/sentences/fr/valve_HassTurnOff.yaml b/sentences/fr/valve_HassTurnOff.yaml new file mode 100644 index 0000000000..706147922c --- /dev/null +++ b/sentences/fr/valve_HassTurnOff.yaml @@ -0,0 +1,11 @@ +language: fr +intents: + HassTurnOff: + data: + - sentences: + - " []{name}" + requires_context: + domain: valve + slots: + domain: valve + response: valve diff --git a/sentences/fr/valve_HassTurnOn.yaml b/sentences/fr/valve_HassTurnOn.yaml new file mode 100644 index 0000000000..df20099bf3 --- /dev/null +++ b/sentences/fr/valve_HassTurnOn.yaml @@ -0,0 +1,11 @@ +language: fr +intents: + HassTurnOn: + data: + - sentences: + - " []{name}" + requires_context: + domain: valve + slots: + domain: valve + response: valve diff --git a/tests/fr/_fixtures.yaml b/tests/fr/_fixtures.yaml index 2b01752fb6..45deeec839 100644 --- a/tests/fr/_fixtures.yaml +++ b/tests/fr/_fixtures.yaml @@ -75,6 +75,7 @@ entities: state: "closed" attributes: device_class: "curtain" + position: "0" - name: "thermostat du salon" id: "climate.living_room" @@ -755,3 +756,19 @@ entities: - name: "liste des courses" id: "todo.liste_des_courses" state: "" + + - name: "valve principale" + id: "valve.main_valve" + state: "open" + attributes: + position: "100" + + - name: "TV" + id: "media_player.tv" + state: "idle" + attributes: + volume_level: "50" + + - name: "Nestor" + id: "vacuum.nestor" + state: "idle" diff --git a/tests/fr/homeassistant_HassSetPosition.yaml b/tests/fr/homeassistant_HassSetPosition.yaml new file mode 100644 index 0000000000..68cb1dc227 --- /dev/null +++ b/tests/fr/homeassistant_HassSetPosition.yaml @@ -0,0 +1,26 @@ +language: fr +tests: + - sentences: + - "Mets le rideau de la chambre à 50%" + intent: + name: HassSetPosition + slots: + name: "rideau de la chambre" + position: 50 + response: "Position réglée" + - sentences: + - "Ouvre le rideau de la chambre à 50%" + intent: + name: HassSetPosition + slots: + name: "rideau de la chambre" + position: 50 + response: "Position réglée" + - sentences: + - "Ajuste la position de la valve principale à 100%" + intent: + name: HassSetPosition + slots: + name: "valve principale" + position: 100 + response: "Position réglée" diff --git a/tests/fr/media_player_HassMediaNext.yaml b/tests/fr/media_player_HassMediaNext.yaml new file mode 100644 index 0000000000..5027fc0e89 --- /dev/null +++ b/tests/fr/media_player_HassMediaNext.yaml @@ -0,0 +1,23 @@ +language: fr +tests: + - sentences: + - "Morceau suivant sur TV" + intent: + name: HassMediaNext + slots: + name: "TV" + response: "Média suivant" + - sentences: + - "Passe au film suivant sur la TV" + intent: + name: HassMediaNext + slots: + name: "TV" + response: "Média suivant" + - sentences: + - "Mets la chanson suivante sur la TV" + intent: + name: HassMediaNext + slots: + name: "TV" + response: "Média suivant" diff --git a/tests/fr/media_player_HassMediaPause.yaml b/tests/fr/media_player_HassMediaPause.yaml new file mode 100644 index 0000000000..1c2c60e7c8 --- /dev/null +++ b/tests/fr/media_player_HassMediaPause.yaml @@ -0,0 +1,10 @@ +language: fr +tests: + - sentences: + - "Mets la TV sur pause" + - "Pause sur TV" + intent: + name: HassMediaPause + slots: + name: "TV" + response: "Lecture en pause" diff --git a/tests/fr/media_player_HassMediaUnpause.yaml b/tests/fr/media_player_HassMediaUnpause.yaml new file mode 100644 index 0000000000..ab68a47482 --- /dev/null +++ b/tests/fr/media_player_HassMediaUnpause.yaml @@ -0,0 +1,11 @@ +language: fr +tests: + - sentences: + - "reprends la lecture sur TV" + - "lecture sur TV" + - "lire sur TV" + intent: + name: HassMediaUnpause + slots: + name: "TV" + response: "Lecture relancée" diff --git a/tests/fr/media_player_HassSetVolume.yaml b/tests/fr/media_player_HassSetVolume.yaml new file mode 100644 index 0000000000..7be74f95ea --- /dev/null +++ b/tests/fr/media_player_HassSetVolume.yaml @@ -0,0 +1,10 @@ +language: fr +tests: + - sentences: + - "Ajuste le volume de la TV à 50 pourcent" + intent: + name: HassSetVolume + slots: + name: "TV" + volume_level: 50 + response: "Volume réglé" diff --git a/tests/fr/vacuum_HassVacuumReturnToBase.yaml b/tests/fr/vacuum_HassVacuumReturnToBase.yaml new file mode 100644 index 0000000000..b3168ba7eb --- /dev/null +++ b/tests/fr/vacuum_HassVacuumReturnToBase.yaml @@ -0,0 +1,9 @@ +language: fr +tests: + - sentences: + - "Renvoie Nestor sur sa base" + intent: + name: HassVacuumReturnToBase + slots: + name: "Nestor" + response: "Retour à la base" diff --git a/tests/fr/vacuum_HassVacuumStart.yaml b/tests/fr/vacuum_HassVacuumStart.yaml new file mode 100644 index 0000000000..7bf587ace5 --- /dev/null +++ b/tests/fr/vacuum_HassVacuumStart.yaml @@ -0,0 +1,9 @@ +language: fr +tests: + - sentences: + - "Démarre Nestor" + intent: + name: HassVacuumStart + slots: + name: "Nestor" + response: "Nettoyage lancé" diff --git a/tests/fr/valve_HassTurnOff.yaml b/tests/fr/valve_HassTurnOff.yaml new file mode 100644 index 0000000000..7bf14706ef --- /dev/null +++ b/tests/fr/valve_HassTurnOff.yaml @@ -0,0 +1,10 @@ +language: fr +tests: + - sentences: + - "ferme la valve principale" + intent: + name: HassTurnOff + slots: + domain: "valve" + name: "valve principale" + response: "Fermé" diff --git a/tests/fr/valve_HassTurnOn.yaml b/tests/fr/valve_HassTurnOn.yaml new file mode 100644 index 0000000000..706ee70d71 --- /dev/null +++ b/tests/fr/valve_HassTurnOn.yaml @@ -0,0 +1,10 @@ +language: fr +tests: + - sentences: + - "Ouvre la valve principale" + intent: + name: HassTurnOn + slots: + domain: "valve" + name: "valve principale" + response: "Ouvert"