• 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-Fuel

Scheduled Pinned Locked Moved Transport
fuel pricegas stationpetrol stationvoice-controltankerkoenigspritpreisrechnernsw
178 Posts 48 Posters 407.3k Views 48 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.
  • D Offline
    Dom1n1c
    last edited by Dec 25, 2016, 4:12 PM

    I did a replacement on the Station names, because “Shell” is typically naming there stations after the Street name.
    I fixed the City name to have only the first Letter in uppercase.
    How can i remove the " null" part, which is occuring at JET stations,
    or how can i tidy up the street names? (every seperate word starting with an uppercase)

    of course i can start with a list of the complete string that should be replaced, but there might be another option.
    Thanks :)

    0_1482682151136_tankstellen.PNG

    S 1 Reply Last reply Dec 25, 2016, 4:41 PM Reply Quote 0
    • S Offline
      strawberry 3.141 Project Sponsor Module Developer @Dom1n1c
      last edited by Dec 25, 2016, 4:41 PM

      @Dom1n1c

      • null @jets is propably that they inserted the house number in the street name and the house number value returns null
      • for the street names i would split at the space character and then for each array item charAt(0).toUpperCase() and the rest of the string lowercase and finally join them together

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

      1 Reply Last reply Reply Quote 1
      • D Offline
        Dom1n1c
        last edited by Dec 25, 2016, 9:38 PM

        I added checks for house numbers==null and splitted the street names.
        Also the Brand names starting with (star,ESSO,Aral were replaced automatically)
        (Shell and no-name stations are a special case, so i need to handle them individually)

        But, there is still another special case:
        Streetnames with " " or “-” should be splitted, but no housenumbers (from JET :D ).
        How can i avoid splitting numbers:
        This is the section that does the splitting
        words = str.toLowerCase().split(/-| /);
        can be found here in total:
        https://github.com/Dom1n1c/MMM-Fuel/blob/master/MMM-Fuel.js

        S 1 Reply Last reply Dec 25, 2016, 9:54 PM Reply Quote 0
        • S Offline
          strawberry 3.141 Project Sponsor Module Developer @Dom1n1c
          last edited by Dec 25, 2016, 9:54 PM

          @Dom1n1c I commented on your changes

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

          1 Reply Last reply Reply Quote 0
          • R Offline
            reaper81
            last edited by Jan 20, 2017, 2:45 PM

            Is it possible to choose other typs of fuel like non-leaded supergrade plus petrol or premium?

            S 1 Reply Last reply Jan 20, 2017, 3:50 PM Reply Quote 0
            • S Offline
              strawberry 3.141 Project Sponsor Module Developer @reaper81
              last edited by Jan 20, 2017, 3:50 PM

              @reaper81 the api only provides diesel e5 and e10 sorry

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

              1 Reply Last reply Reply Quote 0
              • J Offline
                jayjay2017
                last edited by jayjay2017 Mar 11, 2017, 4:30 PM Mar 11, 2017, 3:53 PM

                Hi

                If I take the example with a matching token,
                “Node serveronly” does not start.

                Loading config …
                Loading module helpers …
                WARNING! Could not validate config file. Please correct syntax errors. Starting with default configuration.
                Loading module helpers …
                Whoops! There was an uncaught exception…
                [SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode]
                MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
                If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues

                var config = {
                port: 8070,
                ipWhitelist: [“127.0.0.1”, “::ffff:127.0.0.1”, “::1”, “192.168.1.22”],

                language: 'de',
                timeFormat: 24,
                units: 'metric',
                

                modules: [
                {
                module: ‘MMM-Fuel’,
                position: ‘top_right’,
                config: {
                api_key: ‘f9fXXXXXXX’,
                lat: 51.899177,
                lng: 10.184662,
                types: [‘diesel’],
                }
                }
                ]
                };

                Y S 2 Replies Last reply Mar 11, 2017, 4:27 PM Reply Quote 0
                • Y Offline
                  yawns Moderator @jayjay2017
                  last edited by Mar 11, 2017, 4:27 PM

                  @jayjay2017 please post your config without api keys or check your config on jshint.com

                  1 Reply Last reply Reply Quote 0
                  • S Offline
                    strawberry 3.141 Project Sponsor Module Developer @jayjay2017
                    last edited by Mar 11, 2017, 7:48 PM

                    @jayjay2017 sounds like your node version doesnt support es6 which node version are you using?

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

                    1 Reply Last reply Reply Quote 0
                    • J Offline
                      jayjay2017
                      last edited by Mar 11, 2017, 9:18 PM

                      The version of node was the point. I had Version 4.2.6, now updated to V7.7.2.

                      It works now.

                      Thank you very much.

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