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.

    Defining a module configuration schema standard

    Scheduled Pinned Locked Moved Development
    9 Posts 4 Posters 4.5k Views 5 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.
    • strawberry 3.141S Offline
      strawberry 3.141 Project Sponsor Module Developer
      last edited by strawberry 3.141

      As in the last weeks some solutions (MMM-RemoteControl, MMM-Admin-Interface, MagicMirrorApp, MMM-Mobile, etc.), to easily configure the MagicMirror², came out, I would like to define a standard for 3rd party module developers.

      How should the configuration structure for modules look like so the developers have to put only effort once to include their modules in all solutions.

      I’m pinning some people, who I’m interested on their oppinions:

      @MichMich @Jopyth @ItayXD @aschulz90 @yawns @ianperrin @morozgrafix

      Please create a github issue if you need help, so I can keep track

      J 1 Reply Last reply Reply Quote 2
      • R Offline
        roramirez Core Contributors
        last edited by

        I been working a little pice of work for that. You can check
        https://github.com/roramirez/MagicMirror-Module-Template

        Easy module development with MagicMirror Module Template

        strawberry 3.141S 1 Reply Last reply Reply Quote 2
        • D Offline
          dz
          last edited by

          Hi,
          Yup…I’m looking the same… standard method/structure where we can just include our own modules/solution to it. Looking forward. Thanks

          1 Reply Last reply Reply Quote 1
          • strawberry 3.141S Offline
            strawberry 3.141 Project Sponsor Module Developer @roramirez
            last edited by

            @roramirez you’re off the path it’s about a configuration scheme like

            "maximumEntries": {
              "description": "The maximum number of events shown.",
              "values": {
                "Integer": {
                  "min": 0,
                  "max": 100
                }
              },
              "default": 10
            },
            

            Please create a github issue if you need help, so I can keep track

            R 1 Reply Last reply Reply Quote 0
            • R Offline
              roramirez Core Contributors @strawberry 3.141
              last edited by

              @strawberry-3.141 Ok. For this case is need it uses a library to validate this case .

              On Python I’m using
              http://python-jsonschema.readthedocs.io/en/latest/
              http://validictory.readthedocs.io/en/latest/

              I think for this is need two thing.

              • First define a name in module for configuration schema, like this config.schema

              • After that is required by the core to check if the file exists inside the module and validate configuration, if ok loads the module. But this I think is @MichMich should tell what he think about this.

              The second part is possible do it inside the module too.

              Easy module development with MagicMirror Module Template

              strawberry 3.141S 1 Reply Last reply Reply Quote 0
              • strawberry 3.141S Offline
                strawberry 3.141 Project Sponsor Module Developer @roramirez
                last edited by

                @roramirez this is not for the core, this will be for the configuration solutions out there. so the user can decide which one he wants to use but the developers have to define their schema just once and it will work with all solutions

                Please create a github issue if you need help, so I can keep track

                1 Reply Last reply Reply Quote 0
                • J Offline
                  Jopyth Moderator @strawberry 3.141
                  last edited by

                  @strawberry-3.141 Good idea to get this issue out here.

                  I think JSON Schema (as suggested by @roramirez) seems like a reasonable solution, and if I am right, it is compatible with the JSON Editor the MMM-Admin-Interface already uses.

                  As a file name I think it should end with .json, e.g. config.schema.json. This file should include the configuration options for the module.

                  After we find a good solution, we could add this to the MagicMirrorModule-Template?

                  Helpful sticky: How to troubleshoot

                  strawberry 3.141S 1 Reply Last reply Reply Quote 0
                  • strawberry 3.141S Offline
                    strawberry 3.141 Project Sponsor Module Developer @Jopyth
                    last edited by

                    @Jopyth how about handling global extensions like modulescheduler?

                    Please create a github issue if you need help, so I can keep track

                    1 Reply Last reply Reply Quote 0
                    • R Offline
                      roramirez Core Contributors
                      last edited by

                      I just publish a first release functional of
                      https://github.com/roramirez/MagicMirror-Module-Template

                      If there suggest about include JSON Schema of something else, come on!, let me know

                      Easy module development with MagicMirror Module Template

                      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