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.

    Config editing

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    6 Posts 4 Posters 2.2k Views 4 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.
    • S Do not disturb
      sdetweil @ZeroCool
      last edited by

      @ZeroCool see the topics in my signature below, they will help.

      a module is

      {
           module:
            position:
            config:{
               ... 
             }
      },
      

      notice the trailing comma.

      missing trailing commas are fatal, too.many is not

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 1
      • BKeyportB Offline
        BKeyport Module Developer @ZeroCool
        last edited by

        @ZeroCool

        Keep in mind that many modules have invalid samples. They’re all assuming you’re running one module.

        Basic structure of the modules section:

        	modules: [
        		{
        			module: 'modulename',  // comment
        			position: 'position',
        			config: {
        				key: value,
                                },
        		},
                       {
        ...
                      }.
        /*************** DO NOT EDIT BELOW ***************/
        	]
        };
        
        if (typeof module !== "undefined") {module.exports = config;}
        

        Notice I’ve moved the do not edit line. This is to make it easier for me to find the end.

        Important points:
        once you think you’re ready, run “npm run config:check” in your MagicMirror directory. This will check the config. Any errors will be listed, one by one.

        If you copy and paste from a README.md file, do so from the bracket “{” directly above the keyword “module” to the bracket “}” that matches it vertically. Make sure to add a comma to the closing bracket “},” if it’s not the last module in the list. A graphical editor, such as Geany, is useful for this.

        You can set up drive sharing (SAMBA) to another computer, so you can have the editor up and see the changes right away. Again, Geany is recommended.

        Feel free to ask direct questions, like “it’s reporting unexpected comma on line XX.” and post the relevant code. Make sure to use the code </> button above to paste the code.

        The "E" in "Javascript" stands for "Easy"

        S 1 Reply Last reply Reply Quote 0
        • S Do not disturb
          sdetweil @ZeroCool
          last edited by

          @ZeroCool you can try my MMM-Config module, which creates a form to use for managing config.js

          https://github.com/sdetweil/MMM-Config

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • S Do not disturb
            sdetweil @BKeyport
            last edited by

            @BKeyport nice touch on the do not change below marker…

            also for remote editing

            either WinScp or Bitvise provide ssh clients that present both the command line terminal window AND a graphical file manager view of the pi. (these are both Windows apps) , on Linux you can use the caja file browser to access remotes via different protocols)

            this allows you to click to navigate the pi filesystem and double click to edit the file selected.

            on my windows box I use Notepad++, great brace({}) and bracket ([]) matching
            on linux I use Sublime-text… nearest to notepad++
            multiple files, remembers what you were editing when closed and restarted (including across reboots) …

            Visual studio is also another good editor with similar features

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • M Offline
              magmar @ZeroCool
              last edited by

              @ZeroCool Another thing to keep in mind is the type of the value. Text types must start and end with ", whilst boolean values (true/false) and numbers should not.

              A small example:

              {
                  module: "weather",
                  position: "top_right",
                  config: {
                    type: "current",
                    updateInterval: 600000,
                    useBeaufort: false
              }
              

              Maybe we should add a type-column to the default modules documentation.

              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 Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy