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

SimpleLogo auto change logo not working

Scheduled Pinned Locked Moved Unsolved Troubleshooting
21 Posts 3 Posters 4.6k Views 3 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.
  • R Offline
    RoadRunnr1469
    last edited by Jan 19, 2020, 10:25 PM

    I don’t understand why people have to be so confrontational and un helpful. Making changes the the DEFAULT portion of the main file ONLY affects the initial settings.

    As far as what I mean by auto changing logo, that is what I understood by the documentation for the module.
    Dynamic to me means it will change at a given amount of time…

    ****** Copy/Paste from MMM-SimpleLogo*****
    The MMM-SimpleLogo module supports the notification event SIMPLE_LOGO_UPDATE which allows the configuration to be dynamically modified. As an example, the MMM-OnScreenMenu module might be used to dynamic adjust the fileURL parameter as follows


    1 Reply Last reply Reply Quote 0
    • R Offline
      RoadRunnr1469 @sdetweil
      last edited by Jan 19, 2020, 10:28 PM

      @sdetweil changing the simplelogo.js back and putting updates in config.js has not made any changes. the logo still stays on the same logo, never changes.

      S 1 Reply Last reply Jan 20, 2020, 3:59 AM Reply Quote 0
      • S Offline
        sdetweil @RoadRunnr1469
        last edited by Jan 20, 2020, 3:59 AM

        @RoadRunnr1469 ok, looking thru the code and doc

        Refresh/refetch image file between interval. Only use this if your image url return different image after some interval of time, even the fileUrl is not changed.
        

        the code adds a time to the end of the fileurl to force a unique value. You could do this if the URl to the file stayed the same, but the actual file was different (something overwrote the file since last time)

        so, they planned on the something changing the actual logo file contents

                var imgsrc = self.config.fileUrl;
                    this.interval = setInterval(function() {   // < --- start a recurring timer
                        img = document.querySelector(".simple-logo__container img[src*='" + imgsrc + "']");
                        imgsrc = self.config.fileUrl;
                        if(!imgsrc.includes("?"))
                                imgsrc += '?' + Date.now();  // < ---
                        else
                                imgsrc += '&' + Date.now();  // < -----
                        img.setAttribute('src', imgsrc);
                    }, this.config.refreshInterval);  // < ---  refresh time
                }
        

        the code also allows some other module to send it a message to change the logo url

        I don’t understand why people have to be so confrontational and un helpful.
        

        we are not being ‘un helpful’, the design of the mirror app is to INTENTIONALLY keep people from having to change the module file for different options…

        so, when we see someone going down that path, we want to get them back on the design
        I can look at the module code from github, I can’t see what you did locally. (in general)
        makes it harder to help, and changes made get wiped out if there is a module update…
        (that tends to make people upset when their stuff is lost!)

        but your and my initial understanding of what was supposed to happen (as I didn’t know anything about this module), is wrong… update the cycle time but keep the same exact image and nothing will change.
        you can prove this with 2 logo files.

        start with one, and then copy the other over the 1st while the module is working.

        we are all volunteers here…

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • R Offline
          RoadRunnr1469
          last edited by Jan 25, 2020, 3:09 AM

          The ReadMe file shows this
          cat README.md

          Module: MMM-SimpleLogo

          The MMM-SimpleLogo module is third party modules of the MagicMirror. This module simply displays logo.

          Using the module

          To use this module, add it to the modules array in the config/config.js file:

          modules: [
              {
                  module: 'MMM-SimpleLogo',
                  position: 'top_left',    // This can be any of the regions.
                  config: {
                      // The config property is optional.
                      // See 'Configuration options' for more information.
                  }
              }
          ]
          

          Configuration options

          The following properties can be configured:

          Option Description
          fileUrl File url.

          Possible values: Logo link form internet or path to your local files relative to MagicMirror directory
          Default value: 'modules/MMM-SimpleLogo/public/logo.png'
          width Set width of your logo, height is auto.

          Possible values: '300px' or '50%'
          Default value: '200px'
          position Horizontal position on current container

          Possible values: left, center, or right
          Default value: left
          refreshInterval Refresh/refetch image file between interval. Only use this if your image url return different image after some interval of time, even the fileUrl is not changed. See this case #2, awesome project by @ElYoM

          Possible values: 1000, 2000, or 10000
          Default value: 0 (disabled)
          text Text above the image.

          Possible values: Any text
          Default value: Simple Logo

          Notification Events

          The MMM-SimpleLogo module supports the notification event SIMPLE_LOGO_UPDATE which allows the configuration to be dynamically modified. As an example, the MMM-OnScreenMenu module might be used to dynamic adjust the fileURL parameter as follows:

          {
              module: "MMM-OnScreenMenu",
              position: "top_left",
              config: {
                  menuItems: {
                      notify1: {
                          title: "Show Cat",
                          notification: "SIMPLE_LOGO_UPDATE",
                          payload: {
                              fileUrl: "cat.jpg",
                              width: "750px"
                          }
                      },
                      notify2: {
                          title: "Show Dog",
                          notification: "SIMPLE_LOGO_UPDATE",
                          payload: {
                              fileUrl: "dog.jpg",
                              width: "1050px"
                          }
                      }
                  }
              }
          }
          
          S 1 Reply Last reply Jan 25, 2020, 3:23 AM Reply Quote 0
          • S Offline
            sdetweil @RoadRunnr1469
            last edited by Jan 25, 2020, 3:23 AM

            @RoadRunnr1469 right. Some external module sends a message.

            I didn’t look at that code

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            R 3 Replies Last reply Jan 25, 2020, 3:25 AM Reply Quote 0
            • R Offline
              RoadRunnr1469 @sdetweil
              last edited by Jan 25, 2020, 3:25 AM

              @sdetweil
              Based on the section “Notification Events” I added a section as called out.
              this isn’t letting me paste it in here, says it is spam.

              1 Reply Last reply Reply Quote 0
              • R Offline
                RoadRunnr1469 @sdetweil
                last edited by Jan 25, 2020, 3:29 AM

                @sdetweil

                I added this to the config.js file

                            {
                            module: "MMM-OnScreenMenu",
                                    position: "bottom_right",
                                    config: {
                                            menuItems: {
                                            notify1: {
                                                    title: "Patch",
                                                    notification: "SIMPLE_LOGO_UPDATE",
                                                    payload: {
                                                            fileUrl: "modules/MMM-SimpleLogo/public/Amc.JPG",
                                                            width: "200px"
                                                            }
                
                S 1 Reply Last reply Jan 26, 2020, 4:54 AM Reply Quote 0
                • R Offline
                  RoadRunnr1469 @sdetweil
                  last edited by sdetweil Jan 26, 2020, 4:53 AM Jan 25, 2020, 3:31 AM

                  @sdetweil

                                                          },
                                                  notify2: {
                                                          title: "Support",
                                                          notification: "SIMPLE_LOGO_UPDATE",
                                                          payload: {
                                                                  fileUrl: "modules/MMM-SimpleLogo/public/RedSupport.jpg",
                                                                  width: "150px"
                                                                  }
                                                          },
                  
                  S 1 Reply Last reply Jan 25, 2020, 3:40 AM Reply Quote 0
                  • S Offline
                    sdetweil @RoadRunnr1469
                    last edited by Jan 25, 2020, 3:40 AM

                    @RoadRunnr1469 I won’t be able to look at this til tomorrow or Sunday.

                    Open the developers window ctrl-shift-i select the console tab and scroll up to see any messages sent from the on screen module

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    S 1 Reply Last reply Jan 26, 2020, 4:51 AM Reply Quote 0
                    • S Offline
                      sdetweil @sdetweil
                      last edited by Jan 26, 2020, 4:51 AM

                      @RoadRunnr1469 I installed the module, and modified one of mine to send the notification, and it worked as expected.

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 2 / 3
                      2 / 3
                      • First post
                        11/21
                        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