MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    An "additional" config.js per say

    General Discussion
    2
    4
    701
    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.
    • richland007
      richland007 last edited by

      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

      bhepler 1 Reply Last reply Reply Quote 0
      • bhepler
        bhepler Project Sponsor @richland007 last edited by

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

        richland007 1 Reply Last reply Reply Quote 1
        • richland007
          richland007 @bhepler last edited by

          @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

          bhepler 1 Reply Last reply Reply Quote 0
          • bhepler
            bhepler Project Sponsor @richland007 last edited by

            @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
            • First post
              Last post
            Enjoying MagicMirror? Please consider a donation!
            MagicMirror created by Michael Teeuw.
            Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
            This forum is using NodeBB as its core | Contributors
            Contact | Privacy Policy