Weatherforecast Wunderground module question
Not very experienced in developing in js, so forgive me if this is an easy one ;)
I’ve been hacking away at the default weatherforecast module to have it use weatherunderground. That worked out great! However wu also provides human readable forecasts. (see pic below). Unfortunately the table resizes to accomodate the text. forcing the table to 50% width wraps teh text, but places the table immediately right of the center on the page.
So the question is… how do i get the text to wrap in a reasonably sized table…
If you wrap the text in a div, you can specify the width of the div using CSS.
Or, what you could do, is:
forecastString = forecastString.replace(". ", ".<br />");
This way the text will be wrapped after a period.
As your example only works on the first ". ", i’m now using
this.forecastText.replace(/\.\ /g, “.
btw, the current weather and forecast are in a single api call to wunderground so i’v incorporated both displays in this one module. Also using the current weathericons (windspeed/direction).
Just curious: what’s the benefit of Wunderground?
For me it’s the availability of local weatherstations (@ a location close to me). OpenWeatherMap’s closest match to my location is > 10km away.
Also there’s an extreme amount of data available. Language settings which will provide texts (as in the pic above) in your local language…
Also (i understand) it’s used a lot in domotica systems.
Plus i thought it’d be fun to try :D
Interesting. Don’t know how much time you want to spent on building it, but is would be awesome if you can change the current weather modules in a way a user can configure the weather source. So make it configurable.
If you’re able to make a good stable solution for it (and built it in a way we can add other feeds as well), we could update the core modules.
I’m actually working on my own WUnderground module as well. I like them also for finding a closest station, but also because for some dumb reason, OpenWeatherMap is often REALLY wrong when it comes to the current conditions. The forecast is fairly accurate, but many times it would say it’s 20-30 degrees cooler than it actually is in the current conditions. It’s the same thing when I look on their web site too, so I know it’s not the module messing up. It’s whatever they are using for data collecting, it’s horribly wrong.
I´m also a heavy user of wunderground and appreciate such a Modul.
(So I could use, indirectly, the weather station of my neighbor.
I’m modifying for wunderground now too. I’m finding openweathermap horribly wrong sometimes (today they say showers here and every other forecast system says sun).
I’ve modified the existing weatherforecast module to utilize weather underground… I’m utilizing the weather underground default icons for now. Not sure if it is something of interest for me to modularize or not?