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

Scheduled Pinned Locked Moved Transport
47 Posts 7 Posters 16.8k 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.
  • S Offline
    sdetweil @lif
    last edited by Feb 19, 2024, 1:33 PM

    @lif it’s a fun challenge.

    the downside of changing the modulename.js file is, when an update comes, git pull will fail. and YOU have to figure it out.

    everything takes work. I’m just trying to help you learn the best practice so you don’t get smashed later on.

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    1 Reply Last reply Reply Quote 0
    • S Offline
      stashu
      last edited by Nov 13, 2024, 4:45 PM

      Hi! Thank you for the module, it is my favorite on my MM, as I live on the flight path to KIAD, so lots of activity.

      I am wondering if there is a way I can hide the horizontal line which is under the ‘Flights’ label. When there are no flights, the line is still visible, and I would love if I were able to hide it somehow. I’m happy to add something to custom.css, but I am unsure how to do so. Thanks!

      S K 2 Replies Last reply Nov 13, 2024, 5:25 PM Reply Quote 0
      • S Offline
        sdetweil @stashu
        last edited by sdetweil Nov 13, 2024, 5:31 PM Nov 13, 2024, 5:25 PM

        @stashu So, there is indeed custom.css entry you can use the hide the separator on the header…

        BUT I want to teach you how to find these things yourself… so you won’t be dependant on waiting for someone

        see the second link in my signature below, it will show you how to use the developers window elements tab and locate the element that is displaying the thing you want to modify/hide…

        in the upper right window you can try different styles on the selected element to see its behavior and once you’ve found it, you can copy paste those styles into custom.css
        and put the selector wrapper around it.

        the selector chain is shown on the bottom of the elements window , for example here on another element
        Screenshot at 2024-11-12 15-30-58.png

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        S 1 Reply Last reply Nov 13, 2024, 6:51 PM Reply Quote 0
        • S Offline
          stashu @sdetweil
          last edited by Nov 13, 2024, 6:51 PM

          @sdetweil thanks for the quick reply and the pointer to finding the element. I’m not in web stuff, so it’s a bit more of a mystery to me than I wish it were. Anyway, I found it, and the following custom.css entry works to remove the header:

          .MMM-Flights .module-header {
          	border-bottom: 0px; /* removes line */
          	font-size: 0px; /* removes 'Flights' and logo (?) */
          }
          

          Not sure if that’s an elegant way, but it works :) . I’m not clear on why the 0 font size removes the logo, but it does.

          Thanks again!

          S 1 Reply Last reply Nov 13, 2024, 7:43 PM Reply Quote 0
          • S Offline
            sdetweil @stashu
            last edited by Nov 13, 2024, 7:43 PM

            @stashu all good… sorry for the firehose treatment… lol

            anyhow to hide an element is actually easier

            selector {
               display:none;
            }
            

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • K Offline
              karsten13 @stashu
              last edited by Nov 13, 2024, 9:02 PM

              @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 Jan 5, 2025, 7:14 PM Jan 5, 2025, 7:13 PM

                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

                K 2 Replies Last reply Jan 5, 2025, 9:53 PM Reply Quote 0
                • K Offline
                  karsten13 @wswenson
                  last edited by Jan 5, 2025, 9:53 PM

                  @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
                  • K Offline
                    karsten13 @wswenson
                    last edited by Jan 6, 2025, 7:21 PM

                    @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 Jan 10, 2025, 12:10 PM Reply Quote 0
                    • W Offline
                      wswenson @karsten13
                      last edited by Jan 10, 2025, 12:10 PM

                      @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