MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

MMM-WeatherOrNot - Forecast



  • Re: MMM-WeatherOrNot
    It’s possible to activate/deactivate the current weather e.g.

    currentWeather: "true"/"false" ?
    

  • Module Developer

    @bjoern If there’s nothing in the README about that, you can try to find out the elements id or class and give it display: none in your custom.css

    .MMM-WeatherOrNot .someElement {
      display: none;
    }
    


  • @lavolp3 said in MMM-WeatherOrNot - Forecast:

    .MMM-WeatherOrNot .someElement {
    display: none;
    }

    Thanks a lot, but it does not work.

    .MMM-WeatherOrNot .currentWeather {
      display: none;
    }
    

    i don’t know why. it’s the corect element, in my opinion


  • Module Developer

    @bjoern said in MMM-WeatherOrNot - Forecast:

    @lavolp3 said in MMM-WeatherOrNot - Forecast:

    .MMM-WeatherOrNot .someElement {
    display: none;
    }

    Thanks a lot, but it does not work.

    .MMM-WeatherOrNot .currentWeather {
      display: none;
    }
    

    i don’t know why. it’s the corect element, in my opinion

    I agree, the element selector is the right one.
    It sits in an iframe, that may be the reason.
    I don’t know how to get to the css inside the iframe.



  • Hi @bjoern - so I think this should be possible (although there doesn’t seem to be a way to configure it in the module’s config.js entry just now)

    The MMM-WeatherOrNot readme says that the information it displays is pulled from https://weatherwidget.io/. If you go there and try adjusting the sample widget shown on the site, there’s an option for Current / Forecast, which you can set to Current, Forecast or Both. It looks like it defaults to Both, which I guess is what you’re seeing.

    By trying the different options and clicking on the GET CODE button, I get a code block including either

    data-mode="Forecast"

    data-mode="Current"

    or a block with no data-mode in at all, if I select Both.

    If you look in the MMM-WeatherOrNot.js file you can see at the bottom where this codeblock to pull the correctly-configured information is sort of constructed, based on the values you’ve given in your config.js.

    So it looks like you could theoretically:

    • add a new parameter to your config.js, e.g.
    {
        disabled: false,
        module: 'MMM-WeatherOrNot',
        position: 'middle center',
        config: {
          location: "staten-island",
          dataMode: "Forecast",   // valid options are "Both", "Forecast" or "Current"
    
    • update MMM-WeatherOrNot.js to refer to the parameter - where it shows
    / Insert config options
    		iframe.srcdoc = `<a class="weatherwidget-io"
    

    you could maybe include data-mode="${this.config.dataMode}"

    Something like that anyway. And then it might allow you to control whether the Current weather is shown or just the Forecast using the config.


  • Module Developer

    @raymondjspigot Great idea! You should create a PR from that! Look here @Mykle1



  • @raymondjspigot : thanks a lot. that it’s. works fine!


Log in to reply