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.

    Weather Forecast: showRainAmount displays in mm even when config.units='imperial'

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    9 Posts 3 Posters 4.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.
    • MichMichM Offline
      MichMich
      last edited by

      Hmmm… it seems OpenWeatherMap returns the data in MM no matter which what we request.
      What unit would be preferred? Inch? What notation would you recommend?

      strawberry 3.141S 1 Reply Last reply Reply Quote 0
      • strawberry 3.141S Offline
        strawberry 3.141 Project Sponsor Module Developer @MichMich
        last edited by

        @MichMich wikipedia tells inch for rain measurements https://en.wikipedia.org/wiki/Rain#Measurement

        if(config.units === "imperial"{
          rainCell.innerHTML = forecast.rain / 25.4 + " in";
        }
        

        probably need parseFloat() for the data if its a string

        Please create a github issue if you need help, so I can keep track

        1 Reply Last reply Reply Quote 0
        • F Offline
          fjnorb
          last edited by

          It looks like it is returning millimeters. For instance, it says on Tuesday we’re going to get 15mm of rain, that’s about a half an inch, which is much more reasonable than the notion that we’d get 15 inches (381mm) of rain in one day. That sort of thing would be in the news feed, lol.

          1 Reply Last reply Reply Quote 0
          • MichMichM Offline
            MichMich
            last edited by

            I pushed an update to the develop branch. Please give it a try.

            1 Reply Last reply Reply Quote 1
            • F Offline
              fjnorb
              last edited by

              Can you give me a quick idea of how to do that please? Installation was so simple I don’t know how.

              strawberry 3.141S 1 Reply Last reply Reply Quote 0
              • strawberry 3.141S Offline
                strawberry 3.141 Project Sponsor Module Developer @fjnorb
                last edited by

                @fjnorb

                cd ~/MagicMirror
                git fetch
                git checkout develop
                npm install
                

                Please create a github issue if you need help, so I can keep track

                1 Reply Last reply Reply Quote 0
                • F Offline
                  fjnorb
                  last edited by

                  Looks great! Appreciate the quick fix and quick responses, wish more FOSS projects were this professional and responsive.

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