Read the statement by Michael Teeuw here.
Is hidden the same as disabled?
-
@rudibarani said in Is hidden the same as disabled?:
the notification system to show and re-hide a module when the time is due.
This is somehow obvious. Is it by a schedule? In that case MMM-Scheduler can control its showing and hiding. Even start with hiding.
https://github.com/ianperrin/MMM-ModuleScheduler#individual-module-schedules
Or any other trigger? But MMM-Snow itself has no feature of self hiding/revealing by notification. Other module should hide/show MMM-Snow. -
@rudibarani if it’s disabled in the config then it’s not available to MagicMirror. It wouldn’t be able to show it at a scheduled time because it wouldn’t even be running.
To do what you want to do is perhaps have a script that modifies your config, or replaces one config file with another that enables the module, then have it restart magic mirror. Schedule the script using a cron job. There are plenty of articles online that can help you write such a script and schedule it using cron.
You can use the module scheduler as others suggest but it requires the module to be running even when it is hidden. Since you want it available only during the winter months, this means cpu cycles wasted during the summer. On a low powered device like the Pi, this could be a significant waste, especially if you have other modules that do a lot of heavy lifting.
-
Dear j.e.f.f,
thanks - this is really good to know and helpful advice.
I am new to JS programming - but I am willing to tinker and learn. My current plan was to:- Add notification support to MMM-Snow analog to “USER_PRESENCE”
- Add a config option to start inactive, e.g. “start_inactive:true”
- Add a temp-file that stores the current state of “state_inactive” in case the system reboots.
Then I could send a notification to MMM-Snow to set it active and inactive at the time needed. This might also be interesting for others…
I had a look at other modules and hope, that I can pick up all necessary info from the way, these features have been implemented there.
What do you think of this plan? -
Sending and receiving notifications is the easy part of modules :) Just look in a few of them and see how it works… you’ll pick right up on it!!
-
@rudibarani
Prepare two config -config.snowon.js
andconfig.snowoff.js
.
Make a code to copy one of both toconfig.js
when your trigger is activated. The next time rebooted, it will be applied.
Instead of copying file, you can readconfig.js
and rewrite it directly. but a bullet-proof-parsing js code is not so easy for unexperienced one.)However, MMM-Snow has no
node_helper.js
to refer. You have to buildnode_helper.js
to do your job. (InMMM-Snow.js
itself, approaching filesystem is limited.)