question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New weather module: forecast and forecast/daily support

See original GitHub issue

Hi everybody, I implemented the support for forecast and forecast/daily using openweathermap in PR #1514. As I did not have a apiKey to test the forecast/daily part, I downloaded a sample file from their website and included it in my testing. I am not sure if all cases are handled well, please do check, if you find any other issues.

Thank you very much @fewieden and @vincep5 for you hints and support!

Also before merging my code, we should discuss, if my code is looking as it should:

This part appears twice in the hourly forecast part and a third time (similarly) in the daily forecast part.

minTemp.push(forecast.main.temp_min);
maxTemp.push(forecast.main.temp_max);

if (forecast.hasOwnProperty("rain")) {
	if (this.config.units === "imperial" && !isNaN(forecast.rain["3h"])) {
		rain += forecast.rain["3h"] / 25.4;
	} else if (!isNaN(forecast.rain["3h"])){
		rain += forecast.rain["3h"];
	} else {
		rain += 0;
	}
} else {
	rain += 0;
}

Have a nice weekend!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
fwittecommented, Jan 6, 2019

Rain values of 0 should not be displayed anymore, also I simplified the code. One appearance of the code mentioned above was not required!

1reaction
rts58commented, Jan 23, 2019

Okay, I played around with the config settings. I looked at the API and it recommended only passing the location ID to insure an accurate result. Although not shown above apparently I also had location: . I removed it as above and it is now returning a result. Sorry for the distraction. Although, you may want to consider removing location: from config settings. @vincep5 Thanks for your help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Forecast Models - National Weather Service
This table contains contour plots of data from the NAM forecast model. This model gives forecast information out to 84 hours and are...
Read more >
Weather - Numerical Models - CNRFC
The WRF-NAM model (Weather and Research Forecast Model - North American Mesoscale) produces forecasts out to 3.5 days, four times per day. The...
Read more >
Forecast Models - Tropical Tidbits
Climate models like the CFSv2, CanSIPS, and NMME provide monthly to seasonal forecasts. Products include map displays, model-derived soundings, and vertical ...
Read more >
Forecasts | ECMWF
Forecast charts and data. We provide global forecasts, climate reanalyses and specific datasets, designed to meet different user requirements.
Read more >
Where does your forecast come from? The list of (almost) all ...
The GFS is the most well-known global weather model and it's updated every six hours by the American meteorological service. It is actually...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found