Skip to content

Commit

Permalink
[Fr] Add new intents for cover, valve, vacuum, media player (#1973)
Browse files Browse the repository at this point in the history
* [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 <volume> and <position> expansion rules
Updated tests accordingly
use <regle>, <ouvre> and <ferme> in sentences

* [Fr] Update HassMediaNext

Update the response: Suivant --> Média suivant
Add an expansion_rule <media> with media types (chanson, film...)

* [Fr] Reviewed verbs in new intents

New expansion rules for handling infinitive form of verbs

In the expansion_rule <lire>, 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 <capteur> that was in the questions category

* [Fr] fix HassVacuumReturnToBase verb + response update

Use the expansion_rule <renvoie>
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 <media> 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
  • Loading branch information
slegars56 authored and deejay1 committed Feb 27, 2024
1 parent 10e574b commit fbd8eb5
Show file tree
Hide file tree
Showing 31 changed files with 280 additions and 2 deletions.
5 changes: 5 additions & 0 deletions responses/fr/HassMediaNext.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: fr
responses:
intents:
HassMediaNext:
default: "Média suivant"
5 changes: 5 additions & 0 deletions responses/fr/HassMediaPause.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: fr
responses:
intents:
HassMediaPause:
default: "Lecture en pause"
5 changes: 5 additions & 0 deletions responses/fr/HassMediaUnpause.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: fr
responses:
intents:
HassMediaUnpause:
default: "Lecture relancée"
5 changes: 5 additions & 0 deletions responses/fr/HassSetPosition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: fr
responses:
intents:
HassSetPosition:
default: "Position réglée"
5 changes: 5 additions & 0 deletions responses/fr/HassSetVolume.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: fr
responses:
intents:
HassSetVolume:
default: "Volume réglé"
1 change: 1 addition & 0 deletions responses/fr/HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ responses:
fans: "Ventilateurs éteints"
cover: "Fermé"
lock: "Ouvert"
valve: "Fermé"
1 change: 1 addition & 0 deletions responses/fr/HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ responses:
lock: "Fermé"
scene: "Activée"
script: "Démarré"
valve: "Ouvert"
5 changes: 5 additions & 0 deletions responses/fr/HassVacuumReturnToBase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: fr
responses:
intents:
HassVacuumReturnToBase:
default: "Retour à la base"
5 changes: 5 additions & 0 deletions responses/fr/HassVacuumStart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: fr
responses:
intents:
HassVacuumStart:
default: "Nettoyage lancé"
22 changes: 20 additions & 2 deletions sentences/fr/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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)"
Expand All @@ -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: "<quel> (est|sont)"
what_is_the_class_of_name: "<quelest> (le |la |l'|les )<class> [(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|<dans>|sur)] [<le>]{name} [<dans> [<le>]{area}]"

Expand Down
11 changes: 11 additions & 0 deletions sentences/fr/homeassistant_HassSetPosition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: fr
intents:
HassSetPosition:
data:
- sentences:
- "<regle> [la position de] [<le>]{name} à {position}<pourcent>"
- "(<ouvre>|<ferme>) [<le>]{name} à {position}<pourcent>"
requires_context:
domain:
- cover
- valve
2 changes: 2 additions & 0 deletions sentences/fr/homeassistant_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ intents:
excludes_context:
domain:
- cover
- vacuum
- valve
2 changes: 2 additions & 0 deletions sentences/fr/homeassistant_HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ intents:
excludes_context:
domain:
- cover
- vacuum
- valve
9 changes: 9 additions & 0 deletions sentences/fr/media_player_HassMediaNext.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: fr
intents:
HassMediaNext:
data:
- sentences:
- "<media> suivant[e] sur [<le>]{name}"
- "<mets> (<le>|au|à la) <media> suivant[e] [sur] [<le>]{name}"
requires_context:
domain: media_player
9 changes: 9 additions & 0 deletions sentences/fr/media_player_HassMediaPause.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: fr
intents:
HassMediaPause:
data:
- sentences:
- "<mets> [<le>]{name} sur pause"
- "Pause sur [<le>]{name}"
requires_context:
domain: media_player
9 changes: 9 additions & 0 deletions sentences/fr/media_player_HassMediaUnpause.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: fr
intents:
HassMediaUnpause:
data:
- sentences:
- "<lis> sur [<le>]{name}"
- "<reprends> [la lecture] sur [<le>]{name}"
requires_context:
domain: media_player
8 changes: 8 additions & 0 deletions sentences/fr/media_player_HassSetVolume.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: fr
intents:
HassSetVolume:
data:
- sentences:
- "<regle> [le volume de] [<le>]{name} à {volume:volume_level}<pourcent>"
requires_context:
domain: media_player
8 changes: 8 additions & 0 deletions sentences/fr/vacuum_HassVacuumReturnToBase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: fr
intents:
HassVacuumReturnToBase:
data:
- sentences:
- "<renvoie> [<le>]{name} [(à|sur) (sa|la) base]"
requires_context:
domain: vacuum
8 changes: 8 additions & 0 deletions sentences/fr/vacuum_HassVacuumStart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: fr
intents:
HassVacuumStart:
data:
- sentences:
- "<demarre> [<le>]{name}"
requires_context:
domain: vacuum
11 changes: 11 additions & 0 deletions sentences/fr/valve_HassTurnOff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: fr
intents:
HassTurnOff:
data:
- sentences:
- "<ferme> [<le>]{name}"
requires_context:
domain: valve
slots:
domain: valve
response: valve
11 changes: 11 additions & 0 deletions sentences/fr/valve_HassTurnOn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: fr
intents:
HassTurnOn:
data:
- sentences:
- "<ouvre> [<le>]{name}"
requires_context:
domain: valve
slots:
domain: valve
response: valve
17 changes: 17 additions & 0 deletions tests/fr/_fixtures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ entities:
state: "closed"
attributes:
device_class: "curtain"
position: "0"

- name: "thermostat du salon"
id: "climate.living_room"
Expand Down Expand Up @@ -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"
26 changes: 26 additions & 0 deletions tests/fr/homeassistant_HassSetPosition.yaml
Original file line number Diff line number Diff line change
@@ -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"
23 changes: 23 additions & 0 deletions tests/fr/media_player_HassMediaNext.yaml
Original file line number Diff line number Diff line change
@@ -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"
10 changes: 10 additions & 0 deletions tests/fr/media_player_HassMediaPause.yaml
Original file line number Diff line number Diff line change
@@ -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"
11 changes: 11 additions & 0 deletions tests/fr/media_player_HassMediaUnpause.yaml
Original file line number Diff line number Diff line change
@@ -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"
10 changes: 10 additions & 0 deletions tests/fr/media_player_HassSetVolume.yaml
Original file line number Diff line number Diff line change
@@ -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é"
9 changes: 9 additions & 0 deletions tests/fr/vacuum_HassVacuumReturnToBase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: fr
tests:
- sentences:
- "Renvoie Nestor sur sa base"
intent:
name: HassVacuumReturnToBase
slots:
name: "Nestor"
response: "Retour à la base"
9 changes: 9 additions & 0 deletions tests/fr/vacuum_HassVacuumStart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: fr
tests:
- sentences:
- "Démarre Nestor"
intent:
name: HassVacuumStart
slots:
name: "Nestor"
response: "Nettoyage lancé"
10 changes: 10 additions & 0 deletions tests/fr/valve_HassTurnOff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: fr
tests:
- sentences:
- "ferme la valve principale"
intent:
name: HassTurnOff
slots:
domain: "valve"
name: "valve principale"
response: "Fermé"
10 changes: 10 additions & 0 deletions tests/fr/valve_HassTurnOn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: fr
tests:
- sentences:
- "Ouvre la valve principale"
intent:
name: HassTurnOn
slots:
domain: "valve"
name: "valve principale"
response: "Ouvert"

0 comments on commit fbd8eb5

Please sign in to comment.