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-Flights

    Scheduled Pinned Locked Moved Transport
    53 Posts 9 Posters 32.1k Views 9 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.
    • W Offline
      wswenson
      last edited by wswenson

      I would like to see a configuration option to filter out non-commercial flights. I played around with this code segment and think it could be done with some minor logic added for a configuration option of onlyCommercial (or something like that). I live in an area where there is a high concentration of private planes as well, and generally I am mostly interested in the commercial flights.

      I tried to open an issue in Gitlabs, but wants me to create an account and pay for membership and such.

      Thanks for the module!

       async makeFlightArray(configPayload) {
            let flights = [];
      
            const prov = configPayload.provider.toLowerCase();
            if (this.providers.includes(prov)) {
              await require(`./provider/${prov}`).getData(
                configPayload,
                flights,
                this.airports,
                this.airlines,
                this.planes,
                this.setFlightData,
                this.fetchUrl
              );
            } else {
              Log.error(
                `${this.name}: Unknown provider  + ${configPayload.provider}`
              );
            }
      	  
      	  // Filter out flights with empty airline
            flights = flights.filter((flight) => flight.airline && flight.airline.trim() !== "");
      	  
      	  console.log(flights);
            return flights;
          },
      

      222ff981-bdda-48e5-a800-faeffafc449a-image.png

      karsten13K 2 Replies Last reply Reply Quote 0
      • karsten13K Offline
        karsten13 @wswenson
        last edited by

        @wswenson said in MMM-Flights:

        I tried to open an issue in Gitlabs, but wants me to create an account and pay for membership and such.

        they are free see https://about.gitlab.com/pricing/

        will look into the filter stuff …

        1 Reply Last reply Reply Quote 0
        • karsten13K Offline
          karsten13 @wswenson
          last edited by

          @wswenson said in MMM-Flights:

          I would like to see a configuration option to filter

          now implemented with this commit

          Thanks for the suggestion!

          W 1 Reply Last reply Reply Quote 0
          • W Offline
            wswenson @karsten13
            last edited by

            @karsten13 Very nice and thank you!

            1 Reply Last reply Reply Quote 0
            • N Offline
              noeknl
              last edited by

              Hi there,

              Thanks for this great module!
              Is it still working for other people? I can’t get flights to display on the map, eventhough they are definately there.

              I’ve tried to change the provider from FR24 to readsb, but neither seems to work.
              Am I overlooking something here? Thanks for the help.

              {
                module: "MMM-Flights",
                position: "top_left",
                config: {
                  laMin: 51.6,
                  laMax: 51.0,
                  loMin: 5.2,
                  loMax: 6.2,
                  provider: "readsb",
                  providerUrl: "https://api.airplanes.live/v2/point"
                },
              },
              
              karsten13K 1 Reply Last reply Reply Quote 0
              • karsten13K Offline
                karsten13 @noeknl
                last edited by

                @noeknl

                works with both providers if you switch the content of your laMin/laMax values …

                N 1 Reply Last reply Reply Quote 0
                • N Offline
                  noeknl @karsten13
                  last edited by

                  @karsten13 Oh damn, that was pretty stupid. Thanks for your sharp eye!
                  It works now indeed!!

                  is it possible to locate the list of flights on the right of the map, so I can utilize landscape mode better?

                  karsten13K 1 Reply Last reply Reply Quote 0
                  • karsten13K Offline
                    karsten13 @noeknl
                    last edited by

                    @noeknl said:

                    is it possible to locate the list of flights on the right of the map, so I can utilize landscape mode better?

                    pushed a new version which supports now 4 map positions top, bottom, left, right

                    1 Reply Last reply Reply Quote 1
                    • P Offline
                      philpburns72
                      last edited by

                      Hello, can anyone tell me if there is a way to limit the number of results this returns?
                      Thanks
                      Phil

                      karsten13K 1 Reply Last reply Reply Quote 0
                      • karsten13K Offline
                        karsten13 @philpburns72
                        last edited by

                        @philpburns72 said:

                        if there is a way to limit the number of results this returns?

                        This feature doesn’t exist at the moment. However, I’ve noticed myself that during peak times, the list can get so long that it scrolls off the bottom of the screen.

                        The question is how to implement such a filter. One idea would be a maxPlanes property that displays only the n aircraft closest to your own position (both on the map and in the list). But perhaps you have a better suggestion?

                        1 Reply Last reply Reply Quote 0

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • 1
                        • 2
                        • 3
                        • 3 / 3
                        • 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