MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. scumbelly
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    S
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 7
    • Posts 53
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: MMM-BM-OW when 'no rain' for forecast undefined message received.

      Hi,

      The module works just fine. It’s only when you do not receive a forecasted rain amount . So if Tuesday has 2 returned ( for mm of rain) and Wednesday has no rain then Wednesday displays undefined as a value.

      The code is …

      moment.unix(forecast.daily[X].sunrise).local().format(‘ddd’) + " &nbsp" + “<img class = image src=./modules/MMM-BMW-OW/icons/” + forecast.daily[X].weather[0].main + “.png>” + " &nbsp" + Math.round(forecast.daily[X].temp.max) + “/” + Math.round(forecast.daily[X].temp.min) + " &nbsp &nbsp &nbsp &nbsp &nbsp" + forecast.daily[X].rain + “/mm Rain” + “&nbsp &nbsp &nbsp &nbsp &nbsp”+ until 6 terminates with no + but with ;

      Hope that helps.

      is 0 to 6.

      posted in Troubleshooting
      S
      scumbelly
    • RE: MMM-BM-OW when 'no rain' for forecast undefined message received.

      Sure, thanks.

      I tried a bunch of things and was just thinking about “null” being returned and how to handle it. If rain worked completely then I could try snow and that would cover everything ( I think) I’d want the module to do.

      posted in Troubleshooting
      S
      scumbelly
    • MMM-BM-OW when 'no rain' for forecast undefined message received.

      Hi,
      I added + forecast.daily[0].rain + “/mm Rain” to the MMM-BM-OW module and if there is rain the amount is returned. If there is no rain I receive “undefined”. I would like to show " 0 " (zero) or at least something, but I haven’t been able to as yet figure out how to do it. Anyone have some pointers?

      Cheers.

      posted in Troubleshooting
      S
      scumbelly
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 6 / 6