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.

    Looking for a module to show and hide different modules

    Scheduled Pinned Locked Moved General Discussion
    4 Posts 2 Posters 1.3k Views 2 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.
    • P Offline
      PhilReis
      last edited by PhilReis

      Hello, i looking for a module to show and hide different modules.

      This is for the Spotify-Module with the compliment module. When I hear a song this is displayed to me with the Spotify module. In the middle of my Magic Mirror is the compliment Modul. Now i want show me the spotify module in the middle when I hear a song. the compliment module should then be hidden.
      When then nothing is played on Spotify the spotify module should be hidden and the compliment modul should then show me the compliments in the middle of my Magic Mirror.

      To hide the spotify module if nothing is played i have already added in my custom.css this code:

      .MMM-NowPlayingOnSpotify .NPOS_nothingIsPlayingContent {
      width: 100%;
      display: none;
      }

      This works fine.

      I hope someone can help me!

      0_1526671013260_MM_Spotify.JPG !

      MM with Spotify. When played a song. At the moment.

      0_1526671020740_MM_without_Spotify.JPG !

      MM without Spotify. No song is played

      1 Reply Last reply Reply Quote 0
      • S Away
        sdetweil
        last edited by

        a module to show/hide would not be hard… but, how will you KNOW that spotify is playing (or has ended)…

        does the spotify playing module send notifications of these events?

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • P Offline
          PhilReis
          last edited by

          I found in the code of the spotify module this html code:

          .NPOS_nothingIsPlayingContent

          This code worked when no song is played. So i can say when no song is played nothing are shown.

          1 Reply Last reply Reply Quote 0
          • S Away
            sdetweil
            last edited by

            the question was, how do you KNOW that music is playing? what code tells u?

            I would expect the spotify playing module to do a sendNotification(“spotify_Playing”,something);

            so that other modules might know… it does not do that (looking at the code)…

            you could fork the existing code and add the 2 lines (one playing, one not) of code and submit an enhancement (pull) request to the module owner…

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • 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