Solved Hide/Show Recipe
-
@bugsounet Hello and soory for my ideas but I am searching to find out. I know it will break the update but my idea was that if it worked for me I would make a pull request to merge the code. Please guide me if and when you have the time. Thank you in advance.
-
give me about 30 min and I’ll give it to you
-
@bugsounet Of course you have all the time you need. Again thank you and sorry for my ignorance. And that the different between a newbie and a developer. I am trying 3 days now to make this work and you need only 30 minutes. Shame on me.
-
it’s not just the magic mirror, this man too @bugsounet . I was not talking about modifying the module, I use MMM-page-selector module in order to have 2 pages on my mirror, I then created a very basic recipe in the MMM-GA recipe folder using the page_increment/page_decrement actions to juggle with pages vocally. I was thinking of something similar.
-
This is a sample with “clock”:
var recipe = { transcriptionHooks: { "HIDE_CLOCK": { pattern: "Hide Clock", command: "hide_clock" }, "SHOW_CLOCK": { pattern: "Show Clock", command: "show_clock" }, }, commands: { "hide_clock": { moduleExec: { module: () => { MM.getModules().enumerate((m)=> { if (m.name == "clock") m.hide(1000, {lockString: "RECIPE_LOCKED"}) }) } }, soundExec: { chime: "close" } }, "show_clock": { moduleExec: { module: () => { MM.getModules().enumerate((m)=> { if (m.name == "clock") m.show(1000, {lockString: "RECIPE_LOCKED"}) }) } }, soundExec: { chime: "open" } }, } } exports.recipe = recipe
-
explain:
if (m.name == "clock") m.hide(1000, {lockString: "RECIPE_LOCKED"})
m.name == "clock"
=> clock is the name of the module (case sesitive)
lockString: "RECIPE_LOCKED"}
=> RECIPE_LOCKED is the password for unlock the module (to not override your vocal rule with an other module)(wow doing it in 15 min ! )
Sorry @Anthony I have not many time to respond actually, that’s why it don’t respond very quickly
-
@venditti69500 said in Hide/Show Recipe:
it’s not just the magic mirror, this man too @bugsounet . I was not talking about modifying the module, I use MMM-page-selector module in order to have 2 pages on my mirror, I then created a very basic recipe in the MMM-GA recipe folder using the page_increment/page_decrement actions to juggle with pages vocally. I was thinking of something similar.
Yes, naturaly, incoming notifications is coded natively
-
-
@bugsounet Thank you so much for this. Tested and workes as expected. I really thought that you don’t reply bacause you are tired of all my “newbie questions”. The least I can do is buy you a coffee
One last thing. Can I add in this recipe thesoundExec: { sound: "/../.mp3", },
function? And where exactly should I add it?
-
Thanks for this donate
I’ve Upgrade my code sample
-
@Anthony : it’s good ?
-
@bugsounet It is not Just goog. It awesome. Now I will try to find out how to start the module hidden at start up. Thank you one more time. From now on whenever I post a question in the forum I will wait for your answer even if it will come in a month . The work and help you provide here deserves more than 1-2 coffees.
-
something like that ?
Sample:
var recipe = { commands: { "hide_on_start": { moduleExec: { module: () => { MM.getModules().enumerate((m)=> { if (m.name == "clock") m.hide(1000, {lockString: "RECIPE_LOCKED"}) if (m.name == "MMM-WiFiPassword") m.hide(1000, {lockString: "RECIPE_LOCKED"}) }) } } } }, plugins: { onReady: "hide_on_start" } } exports.recipe = recipe
Note: modules will be hidden when GA is ready
-
@bugsounet Goodmorning from Greece. Man I will try your addition and if it works I really have to buy you more coffees. If this works you have solved my biggest problem. Thanks one more time for your effort and your help. I will try it when I get home and let you know.
-
@Anthony it work very well ! @bugsounet is a real ass-kicker. I will try to change somethings on my recipe like you do for this in order to change pages
-
@alex69 I am pretty sure it will work. He is the inly one for this job. There is nothing that he cannot do. And if there is it cannot be done at all. That’s why from now on whenever I post a question in the forum I will wait for his answer even if it will come in a month.
-
-
@Anthony i’ve test with status too, the module Is hide when GA start, but the command “show” seems don’t run at the same time
-
perhaps a constraint should be added, such as an execution ranking
-
@Anthony thanks, my recipe run good actualy
-
@Anthony in French, prefer the pattern “masque” rather than “cache” ,generates less secondary trouble.