mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 12:12:20 +00:00
Change default for weatherEndpoint according to API 3.0 (#3583)
since API 3.0 is default, weatherEndpoint should be set to "/onecall" Fixes #3574 ATTENTION: since lat / lon defaults to 0 / 0, the weather plugins works after this patch, but shows the weather from https://de.wikipedia.org/wiki/Null_Island if lat / lon is not manually set. --------- Co-authored-by: Karsten Hassel <hassel@gmx.de> Co-authored-by: Pedro Lamas <pedrolamas@gmail.com>
This commit is contained in:
parent
0130dc45ab
commit
7489e51a67
@ -23,6 +23,7 @@ _This release is scheduled to be released on 2025-01-01._
|
|||||||
|
|
||||||
- [updatenotification] Fix pm2 using detection when pm2 script is in MagicMirror root folder (#3576)
|
- [updatenotification] Fix pm2 using detection when pm2 script is in MagicMirror root folder (#3576)
|
||||||
- [core] Fix loading node_helper of modules: avoid black screen, display errors and continue loading with next module (#3578)
|
- [core] Fix loading node_helper of modules: avoid black screen, display errors and continue loading with next module (#3578)
|
||||||
|
- [weather] changed default value for weatherEndpoint of provider openweathermap to "/onecall" (#3574)
|
||||||
|
|
||||||
## [2.29.0] - 2024-10-01
|
## [2.29.0] - 2024-10-01
|
||||||
|
|
||||||
|
@ -17,10 +17,13 @@ WeatherProvider.register("openweathermap", {
|
|||||||
defaults: {
|
defaults: {
|
||||||
apiVersion: "3.0",
|
apiVersion: "3.0",
|
||||||
apiBase: "https://api.openweathermap.org/data/",
|
apiBase: "https://api.openweathermap.org/data/",
|
||||||
weatherEndpoint: "", // can be "onecall", "forecast" or "weather" (for current)
|
// weatherEndpoint is "/onecall" since API 3.0
|
||||||
|
// "/onecall", "/forecast" or "/weather" only for pro customers
|
||||||
|
weatherEndpoint: "/onecall",
|
||||||
locationID: false,
|
locationID: false,
|
||||||
location: false,
|
location: false,
|
||||||
lat: 0, // the onecall endpoint needs lat / lon values, it doesn't support the locationId
|
// the /onecall endpoint needs lat / lon values, it doesn't support the locationId
|
||||||
|
lat: 0,
|
||||||
lon: 0,
|
lon: 0,
|
||||||
apiKey: ""
|
apiKey: ""
|
||||||
},
|
},
|
||||||
@ -90,30 +93,6 @@ WeatherProvider.register("openweathermap", {
|
|||||||
.finally(() => this.updateAvailable());
|
.finally(() => this.updateAvailable());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Overrides method for setting config to check if endpoint is correct for hourly
|
|
||||||
* @param {object} config The configuration object
|
|
||||||
*/
|
|
||||||
setConfig (config) {
|
|
||||||
this.config = config;
|
|
||||||
if (!this.config.weatherEndpoint) {
|
|
||||||
switch (this.config.type) {
|
|
||||||
case "hourly":
|
|
||||||
this.config.weatherEndpoint = "/onecall";
|
|
||||||
break;
|
|
||||||
case "daily":
|
|
||||||
case "forecast":
|
|
||||||
this.config.weatherEndpoint = "/forecast";
|
|
||||||
break;
|
|
||||||
case "current":
|
|
||||||
this.config.weatherEndpoint = "/weather";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Log.error("weatherEndpoint not configured and could not resolve it based on type");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/** OpenWeatherMap Specific Methods - These are not part of the default provider methods */
|
/** OpenWeatherMap Specific Methods - These are not part of the default provider methods */
|
||||||
/*
|
/*
|
||||||
* Gets the complete url for the request
|
* Gets the complete url for the request
|
||||||
|
@ -15,6 +15,8 @@ let config = {
|
|||||||
position: "bottom_bar",
|
position: "bottom_bar",
|
||||||
config: {
|
config: {
|
||||||
location: "Munich",
|
location: "Munich",
|
||||||
|
weatherProvider: "openweathermap",
|
||||||
|
weatherEndpoint: "/weather",
|
||||||
mockData: '"#####WEATHERDATA#####"'
|
mockData: '"#####WEATHERDATA#####"'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,8 @@ let config = {
|
|||||||
config: {
|
config: {
|
||||||
location: "Munich",
|
location: "Munich",
|
||||||
showHumidity: "feelslike",
|
showHumidity: "feelslike",
|
||||||
|
weatherProvider: "openweathermap",
|
||||||
|
weatherEndpoint: "/weather",
|
||||||
mockData: '"#####WEATHERDATA#####"'
|
mockData: '"#####WEATHERDATA#####"'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,8 @@ let config = {
|
|||||||
position: "bottom_bar",
|
position: "bottom_bar",
|
||||||
config: {
|
config: {
|
||||||
location: "Munich",
|
location: "Munich",
|
||||||
|
weatherProvider: "openweathermap",
|
||||||
|
weatherEndpoint: "/weather",
|
||||||
mockData: '"#####WEATHERDATA#####"',
|
mockData: '"#####WEATHERDATA#####"',
|
||||||
windUnits: "beaufort",
|
windUnits: "beaufort",
|
||||||
showWindDirectionAsArrow: true,
|
showWindDirectionAsArrow: true,
|
||||||
|
@ -7,6 +7,8 @@ let config = {
|
|||||||
position: "bottom_bar",
|
position: "bottom_bar",
|
||||||
config: {
|
config: {
|
||||||
location: "Munich",
|
location: "Munich",
|
||||||
|
weatherProvider: "openweathermap",
|
||||||
|
weatherEndpoint: "/weather",
|
||||||
mockData: '"#####WEATHERDATA#####"',
|
mockData: '"#####WEATHERDATA#####"',
|
||||||
decimalSymbol: ",",
|
decimalSymbol: ",",
|
||||||
showHumidity: "wind"
|
showHumidity: "wind"
|
||||||
|
@ -8,8 +8,9 @@ let config = {
|
|||||||
config: {
|
config: {
|
||||||
type: "forecast",
|
type: "forecast",
|
||||||
location: "Munich",
|
location: "Munich",
|
||||||
mockData: '"#####WEATHERDATA#####"',
|
weatherProvider: "openweathermap",
|
||||||
weatherEndpoint: "/forecast/daily",
|
weatherEndpoint: "/forecast/daily",
|
||||||
|
mockData: '"#####WEATHERDATA#####"',
|
||||||
absoluteDates: true
|
absoluteDates: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,9 @@ let config = {
|
|||||||
config: {
|
config: {
|
||||||
type: "forecast",
|
type: "forecast",
|
||||||
location: "Munich",
|
location: "Munich",
|
||||||
mockData: '"#####WEATHERDATA#####"',
|
weatherProvider: "openweathermap",
|
||||||
weatherEndpoint: "/forecast/daily"
|
weatherEndpoint: "/forecast/daily",
|
||||||
|
mockData: '"#####WEATHERDATA#####"'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -8,8 +8,9 @@ let config = {
|
|||||||
config: {
|
config: {
|
||||||
type: "forecast",
|
type: "forecast",
|
||||||
location: "Munich",
|
location: "Munich",
|
||||||
mockData: '"#####WEATHERDATA#####"',
|
weatherProvider: "openweathermap",
|
||||||
weatherEndpoint: "/forecast/daily",
|
weatherEndpoint: "/forecast/daily",
|
||||||
|
mockData: '"#####WEATHERDATA#####"',
|
||||||
showPrecipitationAmount: true,
|
showPrecipitationAmount: true,
|
||||||
colored: true,
|
colored: true,
|
||||||
tableClass: "myTableClass"
|
tableClass: "myTableClass"
|
||||||
|
@ -8,8 +8,9 @@ let config = {
|
|||||||
config: {
|
config: {
|
||||||
type: "forecast",
|
type: "forecast",
|
||||||
location: "Munich",
|
location: "Munich",
|
||||||
mockData: '"#####WEATHERDATA#####"',
|
weatherProvider: "openweathermap",
|
||||||
weatherEndpoint: "/forecast/daily",
|
weatherEndpoint: "/forecast/daily",
|
||||||
|
mockData: '"#####WEATHERDATA#####"',
|
||||||
decimalSymbol: "_",
|
decimalSymbol: "_",
|
||||||
showPrecipitationAmount: true
|
showPrecipitationAmount: true
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,8 @@ let config = {
|
|||||||
config: {
|
config: {
|
||||||
type: "hourly",
|
type: "hourly",
|
||||||
location: "Berlin",
|
location: "Berlin",
|
||||||
|
weatherProvider: "openweathermap",
|
||||||
|
weatherEndpoint: "/onecall",
|
||||||
mockData: '"#####WEATHERDATA#####"'
|
mockData: '"#####WEATHERDATA#####"'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,8 @@ let config = {
|
|||||||
config: {
|
config: {
|
||||||
type: "hourly",
|
type: "hourly",
|
||||||
location: "Berlin",
|
location: "Berlin",
|
||||||
|
weatherProvider: "openweathermap",
|
||||||
|
weatherEndpoint: "/onecall",
|
||||||
mockData: '"#####WEATHERDATA#####"',
|
mockData: '"#####WEATHERDATA#####"',
|
||||||
hourlyForecastIncrements: 2
|
hourlyForecastIncrements: 2
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,8 @@ let config = {
|
|||||||
config: {
|
config: {
|
||||||
type: "hourly",
|
type: "hourly",
|
||||||
location: "Berlin",
|
location: "Berlin",
|
||||||
|
weatherProvider: "openweathermap",
|
||||||
|
weatherEndpoint: "/onecall",
|
||||||
mockData: '"#####WEATHERDATA#####"',
|
mockData: '"#####WEATHERDATA#####"',
|
||||||
showPrecipitationAmount: true,
|
showPrecipitationAmount: true,
|
||||||
showPrecipitationProbability: true
|
showPrecipitationProbability: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user