Navigation

    MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.15.0 is available! For more information about this release, check out this topic.

    Defining a module configuration schema standard

    Development
    4
    9
    2792
    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.141
      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

      J 1 Reply Last reply Reply Quote 2
      • R
        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

        strawberry 3.141 1 Reply Last reply Reply Quote 2
        • D
          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.141
            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
            },
            
            R 1 Reply Last reply Reply Quote 0
            • R
              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.

              strawberry 3.141 1 Reply Last reply Reply Quote 0
              • strawberry 3.141
                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

                1 Reply Last reply Reply Quote 0
                • J
                  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?

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

                    @Jopyth how about handling global extensions like modulescheduler?

                    1 Reply Last reply Reply Quote 0
                    • R
                      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

                      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