• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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

Scheduled Pinned Locked Moved Transport
56 Posts 13 Posters 33.3k Views 12 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
    cowboysdude Module Developer @mochman
    last edited by Sep 30, 2018, 2:42 PM

    @mochman said in MMM-Gas:

    @cowboysdude I just sent you a pull request that should fix their new page.

    I got it and it’s been merged!! HUGE Thank you for fixing this…time is killing me right now :)

    "You can now get fuel data for regular (default), mid-grade, premium, and diesel. I also threw in a way to sort by price or distance (default). I saw you had an items variable in the default config section as well. I assume that was to only show X number of items. I added that to your for loop that iterates through the gas array. "

    He not only fixed it but enhanced it to make it 100% even better! Here’s an example config:

              disabled: false,
              module: "MMM-Gas",
              position: "top_left",
              config: {
                 zip: "14904",
                 items: 10,
                 typeGas: "",	//premium, mid-grade, diesel, or blank for regular
                 sortBy: "price" 	//distance, price
      		}			   
          }, 
    

    See the // notes for added features! Thank you again @mochman

    Do a git pull to update and update your config accordingly :)

    3 1 Reply Last reply Sep 30, 2018, 4:17 PM Reply Quote 1
    • M Offline
      Mykle1 Project Sponsor Module Developer @mochman
      last edited by Sep 30, 2018, 4:12 PM

      @mochman said in MMM-Gas:

      I just sent you a pull request that should fix their new page.

      Well done, sir! Well done!

      Create a working config
      How to add modules

      1 Reply Last reply Reply Quote 0
      • 3 Offline
        3d @cowboysdude
        last edited by Sep 30, 2018, 4:17 PM

        @cowboysdude and @mochman … WOW, nice work!

        The only thing I had to fix was put the ITEMS in quotes…the proper syntax for me was:

        items: "10",
        
        M 1 Reply Last reply Sep 30, 2018, 4:38 PM Reply Quote 1
        • M Offline
          mochman Module Developer @3d
          last edited by mochman Sep 30, 2018, 4:40 PM Sep 30, 2018, 4:38 PM

          @3d Hmm, the code is supposed to use that variable as an integer. What kind of error were you getting when you had items: 10,?

          Edit: Guess it doesn’t matter. Math.min() still works using a string.

          3 1 Reply Last reply Sep 30, 2018, 8:11 PM Reply Quote 1
          • 3 Offline
            3d @mochman
            last edited by Sep 30, 2018, 8:11 PM

            @mochman It wasn’t loading the config.js. So I just stepped through line by line until if failed. Once if failed I put the 10 in quotations and it loaded.

            1 Reply Last reply Reply Quote 0
            • J Offline
              justjim1220 Module Developer
              last edited by Oct 1, 2018, 12:02 AM

              Ok, so I deleted my current GAS module. and reinstalled it.

              I went to the website to check my zip code, which is good.

              I tried it with & without the quotes around the 10.

              Still not working for me… :slightly_frowning_face:

              "Life's Too Short To Dance With Ugly People"
              Jim Hallock - 1995

              1 Reply Last reply Reply Quote 0
              • J Offline
                justjim1220 Module Developer
                last edited by Oct 1, 2018, 12:31 AM

                NVM!!!

                When in doubt, Reboot it out!!!

                :smiling_face_with_sunglasses:

                "Life's Too Short To Dance With Ugly People"
                Jim Hallock - 1995

                1 Reply Last reply Reply Quote 0
                • R Offline
                  rob73
                  last edited by Oct 3, 2018, 1:37 PM

                  Is there any way to remove the Distance column? I live in a small town and dont really need the distances on the display. I hunted around the files a little bit and didnt see anything that I could maybe edit or delete that would remove it.

                  Rob

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    mochman Module Developer
                    last edited by mochman Oct 4, 2018, 7:47 PM Oct 4, 2018, 7:45 PM

                    @rob73 I haven’t tried this to see how it looks, but you may just be able to comment out a few of the lines in MMM-Gas.js
                    Try commenting out the last 2 lines of this code in the getDom() function.

                     var td5 = document.createElement("td");
                     td5.innerHTML = dist;
                     TDrow.appendChild(td5);
                     weatherTable.appendChild(TDrow);
                    

                    It should look like this when you’re done.

                    var td5 = document.createElement("td");
                    td5.innerHTML = dist;
                    //TDrow.appendChild(td5);
                    //weatherTable.appendChild(TDrow);
                    

                    You should also comment out this part as well.

                    var bjumpy = document.createElement("th");
                    bjumpy.setAttribute("style", "text-align:center");
                    bjumpy.classList.add("xsmall");
                    bjumpy.innerHTML = "Distance";
                    //xFCRow.appendChild(bjumpy);
                    //weatherTable.appendChild(xFCRow);
                    
                    R 1 Reply Last reply Oct 5, 2018, 5:35 PM Reply Quote 1
                    • R Offline
                      rob73 @mochman
                      last edited by Oct 5, 2018, 5:35 PM

                      @mochman … Awesome… I followed your instructions and it worked! Thank you! I would have never figured that out on my own…

                      Thanks again!

                      Rob

                      1 Reply Last reply Reply Quote 1
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 6
                      • 2 / 6
                      2 / 6
                      • First post
                        18/56
                        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