• 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-Moon shows only "No Image!"

Scheduled Pinned Locked Moved Solved Troubleshooting
12 Posts 3 Posters 2.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.
  • F Offline
    Fillan90 @sdetweil
    last edited by Jan 12, 2024, 10:52 PM

    @sdetweil
    config.js:

    module: "MMM-Moon",
            position: "top_left",
            config: {
              width: "400px",      //    as per requirement
              height: "400px",       //    as per requirement
              lat: 59.325,
              lon: 18.050,
              timezone: "Europe/Stockholm"
    

    MMM-Moon.js:

    start: function () {},
      getDom: function () {
        const outerDiv = document.createElement("div");
        if (this.content) {
          const img = document.createElement("img");
          img.src = this.content;
          img.style.width = this.config.width || "100%"; // add this line to set the width of the image
          img.style.height = this.config.height || "auto"; // add this line to set the height of the image
          outerDiv.appendChild(img);
        } else {
          outerDiv.innerText = "No image!";
        }
        return outerDiv;
    
    S 1 Reply Last reply Jan 12, 2024, 11:09 PM Reply Quote 0
    • S Away
      sdetweil @Fillan90
      last edited by Jan 12, 2024, 11:09 PM

      @Fillan90 which MMM-Moon

      (git remote -v)

      NEVER edit the source…

      all config goes in config/config.js
      all css goes in css/custom.css

      there is not enough code there to do the job

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      F 1 Reply Last reply Jan 12, 2024, 11:38 PM Reply Quote 0
      • F Offline
        Fillan90 @sdetweil
        last edited by Jan 12, 2024, 11:38 PM

        @sdetweil
        [https://github.com/EnderFlop/MMM-Moon](link url)

        S 1 Reply Last reply Jan 13, 2024, 12:05 AM Reply Quote 0
        • S Away
          sdetweil @Fillan90
          last edited by Jan 13, 2024, 12:05 AM

          @Fillan90 yes, I installed it and used your config and got error 422 (not executed)

          i’d say that the API changed, but the module hasn’t

          I see there is a submitted pull request that supposedly fixes this

          do this

          cd ~/MagicMirror/modules/MMM-Moon
          

          if you changed any files, change them back

          git status
          

          will tell you which were modified

          git checkout  xxx
          

          where xxx is a filename that changed

          then

          git fetch origin pull/5/head:pr_branch
          git checkout  pr_branch
          

          then restart mm

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          F 1 Reply Last reply Jan 13, 2024, 12:13 AM Reply Quote 1
          • F Offline
            Fillan90 @sdetweil
            last edited by Jan 13, 2024, 12:13 AM

            @sdetweil
            That fixed it, thank you so much.
            /F

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