Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix openweather forecast in new weather module, fetch daily data #1506

Conversation

fwitte
Copy link
Contributor

@fwitte fwitte commented Jan 4, 2019

See #1504

Example

{
	module: "weather",
	position: "top_right",
	header: "Wetter",
	config: {
		type: "current",
		degreeLabel: true,
		location: "Oldenburg",
		locationID: "2857458",
		apiKey: "myapiKey"
	}
},
{
	module: "weather",
	position: "top_right",
	header: "Vorhersage",
	config: {
		type: "forecast",
		degreeLabel: true,
		weatherEndpoint: "/forecast",
		location: "Oldenburg",
		locationID: "2857458",
		apiKey: "myapiKey"
	}
},

looks like this now:
grafik

Note that for the forecast to work with a free API-subscription from openweathermap, you must provide weatherEndpoint: "/forecast"! weatherEndpoint: "/forecast/daily" returns error 401, as it is used for the 16-day forecast and requires the Startup-subscription at minimum!

@MichMich MichMich changed the base branch from master to develop January 4, 2019 12:02
@vincep5
Copy link
Contributor

vincep5 commented Jan 4, 2019

I use openweathermap (the free version) and have access to forecast/daily. I must be grandfathered in. In any case, if the project wants to support both /forecast/daily and /forecast, then these commits will not work with /forecast/daily. It does not have forecast.rain["3h"]

@MichMich MichMich merged commit a5da347 into MagicMirrorOrg:develop Jan 4, 2019
@fewieden
Copy link
Contributor

fewieden commented Jan 5, 2019

As mentioned in my initial pull request #1488 (comment) there was currently no support for newer api keys in the forecast.

This mr broke now the support for the old api keys.

@fwitte
Copy link
Contributor Author

fwitte commented Jan 5, 2019

Hi @fewieden,
I am sorry, I did not see that. Do you happen to know, if a different API key (new/old) yields different .json files for the same query? Are the data generated from .../data/forecast?... always the same no matter which key you supply? Unfortunately I can not test this, as I have the new key only.
If the formatting depends on the key, do you know how to identify the difference in the keys?
I am happy to adjust the code to work with both variants.
Thank you and have a nice weekend!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants