• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

An "additional" config.js per say

Scheduled Pinned Locked Moved General Discussion
4 Posts 2 Posters 1.2k Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    richland007
    last edited by Dec 27, 2018, 1:03 AM

    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

    B 1 Reply Last reply Dec 27, 2018, 1:30 AM Reply Quote 0
    • B Offline
      bhepler Module Developer @richland007
      last edited by Dec 27, 2018, 1:30 AM

      @richland007 - It sounds like you’re referring to the external file option in the Compliments module.

      R 1 Reply Last reply Dec 27, 2018, 1:50 AM Reply Quote 1
      • R Offline
        richland007 @bhepler
        last edited by Dec 27, 2018, 1:50 AM

        @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

        B 1 Reply Last reply Dec 28, 2018, 8:04 PM Reply Quote 0
        • B Offline
          bhepler Module Developer @richland007
          last edited by Dec 28, 2018, 8:04 PM

          @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.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          1 / 1
          • First post
            4/4
            Last post
          Enjoying MagicMirror? Please consider a donation!
          MagicMirror created by Michael Teeuw.
          Forum managed by Sam, technical setup by Karsten.
          This forum is using NodeBB as its core | Contributors
          Contact | Privacy Policy