New weather module: forecast and forecast/daily support
See original GitHub issueHi 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:
- Created 5 years ago
- Comments:12 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Rain values of 0 should not be displayed anymore, also I simplified the code. One appearance of the code mentioned above was not required!
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.