MagicMirror Forum

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

    Starting from an existing module?

    Development
    2
    6
    258
    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.
    • sifuhall
      sifuhall last edited by

      I saw in this post a couple of people recommend starting with an existing module when attempting to create your own module.

      I have a JSON command that returns information I was to display on my Magic Mirror.

      The only two variables I want to specify in the config are the device IDs to pass to the JSON command and the amount of time (in minutes?) I would like to refresh this data.

      What would be a good module to start with for these requirements?

      S 1 Reply Last reply Reply Quote 0
      • S
        sdetweil @sifuhall last edited by sdetweil

        @sifuhall what is the ‘json command’ written in? python?

        see my PythonPrint module
        https://github.com/sdetweil/MMM-PythonPrint

        which launches a python script, captures it’s print/stdout content, and sends it to the front end to process

        it can launch python scripts that output repeatedly over time, or it can launch a one time script on some timed cycle

        Sam

        Create a working config
        How to add modules

        sifuhall 1 Reply Last reply Reply Quote 0
        • sifuhall
          sifuhall @sdetweil last edited by

          @sdetweil

          Thanks for the reply.

          The JSON command works from a browser.

          This is the command
          http://192.168.1.9/JSON?request=getstatus&ref=260,175,233

          260,175,233 would be the IDs I would like to pass

          S 1 Reply Last reply Reply Quote 0
          • S
            sdetweil @sifuhall last edited by sdetweil

            @sifuhall you should be able to do that right in the browser side with built in fetch()

            Sam

            Create a working config
            How to add modules

            sifuhall 1 Reply Last reply Reply Quote 0
            • sifuhall
              sifuhall @sdetweil last edited by

              @sdetweil Thank you

              S 1 Reply Last reply Reply Quote 0
              • S
                sdetweil @sifuhall last edited by

                @sifuhall my SampleModule has all the parts. u won’t need the helper if fetch works

                Sam

                Create a working config
                How to add modules

                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