Read the statement by Michael Teeuw here.
An "additional" config.js per say
-
Hi all and Merry Christmas,
Sometime ago i read about either a module or a feature of MM, that someone could use in case the actual config.js got too big and long…however now for the life of me i can not find out where did i read about that and what it was .
It was something that could reference an other config file of some sort if you did not want to overload the actual config.js.
I am trying to install MMM-AlexaOnOff but i have a lot of modules that i will have to write lines about on and off and than some combination on and offs (that will turn the modules for my wife on and hide mine and vice versa) so one could imagine how long that module config is going to get.
Can someone point me into the right direction please and thank you??D
-
@richland007 - It sounds like you’re referring to the external file option in the Compliments module.
-
@bhepler Yes i think you are right…dang it.
Is there a way to achieve what i am trying to do without writing this big module onto my config.js ???
Probably not but worth asking i think
thank you for your reply
Denis -
@richland007 - It certainly is possible. If you’re just passing in a data JSON, then you can use the technique in the Compliments module. The
config.js
really is just a configuration file, right? The Compliments module has a smattering of code to load the external file as straight JSON and treat that data as an array, IIRC. It basically moves the configuration just for that module to an external file.You can look at the code in the Compliments module at the main MagicMirror git project. It’s like one function to pull from the file system and a little code to detect that the file name was set in the main
config.sys
.