mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
update weathergov provider to try fetching not just current but also forecast when API URLs available
This commit is contained in:
parent
4c345c4f33
commit
1a8413d8f0
@ -18,6 +18,7 @@ _This release is scheduled to be released on 2021-10-01._
|
|||||||
- Updated github templates.
|
- Updated github templates.
|
||||||
- Actually test all js and css files when lint script is run.
|
- Actually test all js and css files when lint script is run.
|
||||||
- Update jsdocs and print warnings during testing too
|
- Update jsdocs and print warnings during testing too
|
||||||
|
- Update weathergov provider to try fetching not just current, but also foreacst, when API URLs available.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ WeatherProvider.register("weathergov", {
|
|||||||
|
|
||||||
// Set the default config properties that is specific to this provider
|
// Set the default config properties that is specific to this provider
|
||||||
defaults: {
|
defaults: {
|
||||||
apiBase: "https://api.weatherbit.io/v2.0",
|
apiBase: "https://api.weather.gov/points/",
|
||||||
weatherEndpoint: "/forecast",
|
weatherEndpoint: "/forecast",
|
||||||
lat: 0,
|
lat: 0,
|
||||||
lon: 0
|
lon: 0
|
||||||
@ -129,7 +129,12 @@ WeatherProvider.register("weathergov", {
|
|||||||
.finally(() => {
|
.finally(() => {
|
||||||
// excellent, let's fetch some actual wx data
|
// excellent, let's fetch some actual wx data
|
||||||
this.configURLs = true;
|
this.configURLs = true;
|
||||||
this.fetchCurrentWeather();
|
// handle 'forecast' config, fall back to 'current'
|
||||||
|
if (config.type == "forecast") {
|
||||||
|
this.fetchWeatherForecast();
|
||||||
|
} else {
|
||||||
|
this.fetchCurrentWeather();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user