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.

    MMM-Gas-storage-EU

    Scheduled Pinned Locked Moved Utilities
    5 Posts 2 Posters 637 Views 2 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.
    • C Offline
      coernel
      last edited by

      I just programmed my first JavaScript program ever. It is no big thing but it works (thanks to ChatGPT)…

      So the module shows a battery icon and the amount of stored gas for a specified EU country (according to country codes such as DE,IT, FR etc.
      The size of the font and battery change according to the amount. The lesser gas, the bigger the icon (as it is more important now).
      For now I am still testing if the module updates as wished. Is it enough to add

      defaults: {
      reloadInterval: 1000 * 60 * 60 * 2, // all 2 hours - really should be enough once a day but who knows when this time will be?
      },
      

      ??? or is there more to do?
      I will think about my module a bit longer if there are other things to consider.

      Do you have any specific wished I could implement?
      I will publish a beta soon.

      gas1.JPG

      gas2.JPG

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

        @coernel cool

        you can calculate the next time of day u want to refresh… end of day -now + time to refresh

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        C 1 Reply Last reply Reply Quote 0
        • C Offline
          coernel @sdetweil
          last edited by

          @sdetweil as I am really still a noob would you be so friendly to give me the exact line of code? If I do it it will take either a minute if my first guess is right or even half an hour.

          The main problem is that I do not know, when Gas Infrastructure Europe updates the values. Are they live? Set at midnight or maybe at six in the morning? I will try to find that out. So for now a 2 hour update interval will be a good compromise.

          So defining reloadInterval is enough to trigger a reload?

          S 2 Replies Last reply Reply Quote 0
          • S Away
            sdetweil @coernel
            last edited by

            @coernel said in MMM-Gas-storage-EU:

            So defining reloadInterval is enough to trigger a reload?

            depends on the coding…

            Sam

            How to add modules

            learning how to use browser developers window for css changes

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

              @coernel said in MMM-Gas-storage-EU:

              The main problem is that I do not know, when Gas Infrastructure Europe updates the values.

              should find that out first

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              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