Solved Return to Main Page after set time.
-
Hello
Im sorry if its obvious or been discussed before, but how can I return pages back to home page (Page 0) after a set amount of time.I have tried MMM-Pages and it has rotationHomePage that works awesome.Is it possible with EXT-Pages. -
Bonjour, oui je pense que vous recherchez rotationTimes: {temps} qui renvoi a home page.
-
Thank you for your reply.
Could you give me a example of code in order to accomplish what I am after? -
@japmagicmirror33 je ne sais pas si cela peut vous aider, mais vous pouvez vous aider de cela pour créer votre propre recette, vous n’aurez qu’à modifier le nom des pages concernées et le délai : link text
-
@japmagicmirror33 exemple : ```
var recipe = {
transcriptionHooks: {
“Page2”: {
pattern: “mets la page 2”,
command: “PAGE2”
},
},
commands: {
“PAGE2”: {
moduleExec: {
module: () => {
this.sendNotification(“EXT_PAGES-CHANGED”, 2)
setTimeout(() => {
this.sendNotification(“EXT_PAGES-HOME”)
}, 15000)
}
}
}
}
}exports.recipe = recipe
Cette recette affichera la page 2 pendant 15 secondes puis retournera à la page principale.
-
Hello
Thank you for your help, unfortunately I could not get it to work.
I really appreciate you taking the time to assist me. -
var recipe = { transcriptionHooks: { "PAGEHOME": { pattern: "go to main page", command: "PAGEHOME" }, "PAGE1": { pattern: "go to page 1", command: "PAGE1" }, "PAGE2": { pattern: "go to page 2", command: "PAGE2" }, "ADMIN": { pattern: "go to admin", command: "PAGEADMIN" } }, commands: { "PAGEHOME": { notificationExec: { notification: "EXT_PAGES-HOME" } }, "PAGE1": { notificationExec: { notification: "EXT_PAGES-CHANGED", payload: 1 } }, "PAGE2": { moduleExec: { module: () => { this.sendNotification("EXT_PAGES-CHANGED", 2) setTimeout(() => { this.sendNotification("EXT_PAGES-HOME") }, 15000) } } }, "PAGEADMIN": { notificationExec: { notification: "EXT_PAGES-HIDDEN_SHOW", payload: "admin" } } } }; exports.recipe = recipe;
-
I think this is better for “PAGE2” in commands
"PAGE2": { moduleExec: { module: ["Gateway"], exec: (module) => { module.sendNotification("EXT_PAGES-CHANGED", 2) setTimeout(() => { module.sendNotification("EXT_PAGES-HOME") }, 15000) } } },
-
@bugsounet
I have been pulling my hair out trying to figure it out.
While pulling my hair out a bugsnounet comes along and whips up some code and it works 100%
Thank You for an awesome project and being involved in the community.