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
    47 Posts 7 Posters 18.3k Views 7 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.
    • karsten13K Online
      karsten13 @stashu
      last edited by

      @stashu said in MMM-Flights:

      if there is a way I can hide the horizontal line which is under the ‘Flights’ label.

      I updated the module, if you now set title and logoTitle to empty strings no header and no line is diplayed anymore.

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