Skip to content

Commit 83f4064

Browse files
committed
Ajout fonction télécommande
1 parent 925b4e1 commit 83f4064

File tree

4 files changed

+73
-71
lines changed

4 files changed

+73
-71
lines changed

index.html

-34
This file was deleted.

plex.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exports.action = function(data, callback, config, SARAH){
44
if (!config.server){
55
console.log("Missing Plex server config");
66
callback({'tts' : 'Il manque la configuration du serveur plex'});
7-
return;
7+
return;
88
}
99
if (!config.client){
1010
console.log("Missing client config");
@@ -34,7 +34,6 @@ exports.action = function(data, callback, config, SARAH){
3434

3535
}
3636

37-
3837
var playback = function(action, callback, config) {
3938
commande = 'system/players/'+config.client+'/playback/'+action;
4039
getPlex(commande, config, callback) ;
@@ -145,7 +144,6 @@ var getPlex = function(commande, config, callback){
145144

146145

147146
var output = function ( callback, output ) {
148-
//console.log('ACTION: ' + output);
147+
console.log('ACTION: ' + output);
149148
callback({ 'tts' : output});
150-
}
151-
149+
}

plex.prop

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"modules" : {
33
"plex" : {
44
"description": "Plioter plex",
5-
"version" : "0.1",
6-
"server" : "192.168.0.11",
7-
"client" : "loki",
8-
"Sectionserie" : "3",
5+
"version" : "0.2",
6+
"server" : "[IP du SERVEUR]",
7+
"client" : "[Ip du client]",
8+
"Sectionserie" : "[N� de section s�rie]",
99
"lastAddTime" :"1"
1010
}
1111
}
12-
}
12+
}

plex.xml

+65-27
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,74 @@
1-
<grammar version="1.0" xml:lang="fr-FR" mode="voice" root="rulePlex" xmlns="http://www.w3.org/2001/06/grammar" tag-format="semantics/1.0">
1+
<grammar version="1.0" xml:lang="fr-FR" mode="voice" root="rulePlex" xmlns="http://www.w3.org/2001/06/grammar" tag-format="semantics/1.0">
22

3-
<rule id="rulePlex" >
3+
<rule id="rulePlex" scope="public">
44
<tag>out.action=new Object(); </tag>
55
<item>Sarah</item>
66
<one-of>
7-
<!-- NAVIGATION -->
8-
<item>plex client<tag>out.action="client";</tag></item>
9-
<item>plex retour<tag>out.action="navigation";out.commande="back"</tag></item>
10-
<item>plex bac<tag>out.action="navigation";out.commande="back"</tag></item>
11-
<item>plex revient<tag>out.action="navigation";out.commande="back"</tag></item>
12-
<item>plex haut<tag>out.action="navigation";out.commande="moveUp"</tag></item>
13-
<item>plex bas<tag>out.action="navigation";out.commande="moveDown"</tag></item>
14-
<item>plex gauche<tag>out.action="navigation";out.commande="moveLeft"</tag></item>
15-
<item>plex droite<tag>out.action="navigation";out.commande="moveRight"</tag></item>
16-
<item>plex haut rapide<tag>out.action="navigation";out.commande="pageUp"</tag></item>
17-
<item>plex bas rapide<tag>out.action="navigation";out.commande="pageDown"</tag></item>
18-
<item>plex bas rapide<tag>out.action="navigation";out.commande="pageDown"</tag></item>
19-
<item>plex lettre suivante<tag>out.action="navigation";out.commande="nextLetter"</tag></item>
20-
<item>plex lettre précédente<tag>out.action="navigation";out.commande="previousLetter"</tag></item>
21-
<item>plex selection<tag>out.action="navigation";out.commande="select"</tag></item>
22-
<item>plex ok<tag>out.action="navigation";out.commande="select"</tag></item>
23-
<item>plex selectioner<tag>out.action="navigation";out.commande="select"</tag></item>
24-
<item>plex lance<tag>out.action="navigation";out.commande="select"</tag></item>
25-
<item>plex selectione<tag>out.action="navigation";out.commande="select"</tag></item>
26-
<item>plex entré<tag>out.action="navigation";out.commande="select"</tag></item>
27-
<item>plex reveil<tag>out.action="navigation";out.commande="select"</tag></item>
28-
<item>plex reveil toi<tag>out.action="navigation";out.commande="select"</tag></item>
29-
<item>plex menu<tag>out.action="navigation";out.commande="contextMenu"</tag></item>
30-
<!-- Lecture -->
31-
<item>plex pause<tag>out.action="playback";out.commande="pause"</tag></item>
7+
<item><ruleref uri="#rulePlex_sys"/><tag>out.action= rules.rulePlex_sys;</tag></item>
8+
<item><ruleref uri="#rulePlex_nav"/><tag>out.action= rules.rulePlex_nav;</tag></item>
9+
<item><ruleref uri="#rulePlex_play"/><tag>out.action= rules.rulePlex_play;</tag></item>
3210
</one-of>
3311
<tag>out.action._attributes.uri="http://127.0.0.1:8080/sarah/plex";</tag>
3412
</rule>
3513

14+
<rule id="rulePlex_sys">
15+
<one-of>
16+
<item>quel sont les clients plex<tag>out.action="client";</tag></item>
17+
<item>quoi de neuf sur plex<tag>out.action="lastAdd";</tag></item>
18+
<item>quel sont les dernières series<tag>out.action="lastAdd";</tag></item>
19+
</one-of>
20+
</rule>
21+
22+
<rule id="rulePlex_nav">
23+
<tag>out.action="navigation";</tag>
24+
<one-of>
25+
<!-- NAVIGATION -->
26+
<item>plex retour<tag>out.commande="back";</tag></item>
27+
<item>plex bac<tag>out.commande="back";</tag></item>
28+
<item>plex revient<tag>out.commande="back";</tag></item>
29+
<item>plex haut<tag>out.commande="moveUp";</tag></item>
30+
<item>plex bas<tag>out.commande="moveDown";</tag></item>
31+
<item>plex gauche<tag>out.commande="moveLeft";</tag></item>
32+
<item>plex droite<tag>out.commande="moveRight";</tag></item>
33+
<item>plex haut rapide<tag>out.commande="pageUp";</tag></item>
34+
<item>plex bas rapide<tag>out.commande="pageDown";</tag></item>
35+
<item>plex bas rapide<tag>out.commande="pageDown";</tag></item>
36+
<item>plex lettre suivante<tag>out.commande="nextLetter";</tag></item>
37+
<item>plex lettre précédente<tag>out.commande="previousLetter";</tag></item>
38+
<item>plex selection<tag>out.commande="select";</tag></item>
39+
<item>plex ok<tag>out.commande="select";</tag></item>
40+
<item>plex selectioner<tag>out.commande="select";</tag></item>
41+
<item>plex lance<tag>out.commande="select";</tag></item>
42+
<item>lance l'épisode<tag>out.commande="select";</tag></item>
43+
<item>lance le film<tag>out.commande="select";</tag></item>
44+
<item>plex selectione<tag>out.commande="select";</tag></item>
45+
<item>plex entré<tag>out.commande="select";</tag></item>
46+
<item>plex reveil<tag>out.commande="select";</tag></item>
47+
<item>plex reveil toi<tag>out.commande="select";</tag></item>
48+
<item>plex menu<tag>out.commande="contextMenu";</tag></item>
49+
</one-of>
50+
</rule>
51+
<rule id="rulePlex_play">
52+
<tag>out.action="playback";</tag>
53+
<one-of>
54+
<!-- Lecture -->
55+
<item>plex pause<tag>out.commande="pause"</tag></item>
56+
<item>met plex en pause<tag>out.commande="pause"</tag></item>
57+
<item>plex sur pause <tag>out.commande="pause"</tag></item>
58+
<item>plex play<tag>out.commande="play"</tag></item>
59+
<item>plex lecture<tag>out.commande="play"</tag></item>
60+
<item>plex reprend la lecture<tag>out.commande="play"</tag></item>
61+
<item>plex reprend le film<tag>out.commande="play"</tag></item>
62+
<item>plex reprend la lecture<tag>out.commande="play"</tag></item>
63+
<item>plex reprend la série<tag>out.commande="play"</tag></item>
64+
<item>reprend la lecture sur plex<tag>out.commande="play"</tag></item>
65+
<item>reprend le film<tag>out.commande="play"</tag></item>
66+
<item>reprend la série<tag>out.commande="play"</tag></item>
67+
<item>plex stop<tag>out.commande="stop"</tag></item>
68+
</one-of>
69+
</rule>
70+
71+
72+
73+
3674
</grammar>

0 commit comments

Comments
 (0)