mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 04:45:17 +00:00
Add openmeteo precipitation probability (#3099)
Due to the size of the commit there is no need for a long explanation: Openmeteo supports precipitation probability in api, but the weather provider .js had no support for it. After adding 4 lines it works as expected. This should have no consequences on other files but improves usability for (imo) the best weather provider. --------- Co-authored-by: veeck <michael@veeck.de>
This commit is contained in:
@@ -21,6 +21,7 @@ _This release is scheduled to be released on 2023-07-01._
|
|||||||
|
|
||||||
### Updated
|
### Updated
|
||||||
|
|
||||||
|
- Added support for precipitation probability with openmeteo weather provider
|
||||||
- Update electron to v24
|
- Update electron to v24
|
||||||
- Use node v20 in github workflow (replacing v14)
|
- Use node v20 in github workflow (replacing v14)
|
||||||
- Refactor formatTime into common util function for default modules
|
- Refactor formatTime into common util function for default modules
|
||||||
|
@@ -76,6 +76,8 @@ WeatherProvider.register("openmeteo", {
|
|||||||
"et0_fao_evapotranspiration",
|
"et0_fao_evapotranspiration",
|
||||||
// Total precipitation (rain, showers, snow) sum of the preceding hour
|
// Total precipitation (rain, showers, snow) sum of the preceding hour
|
||||||
"precipitation",
|
"precipitation",
|
||||||
|
//Precipitation Probability
|
||||||
|
"precipitation_probability",
|
||||||
// Snowfall amount of the preceding hour in centimeters. For the water equivalent in millimeter, divide by 7. E.g. 7 cm snow = 10 mm precipitation water equivalent
|
// Snowfall amount of the preceding hour in centimeters. For the water equivalent in millimeter, divide by 7. E.g. 7 cm snow = 10 mm precipitation water equivalent
|
||||||
"snowfall",
|
"snowfall",
|
||||||
// Rain from large scale weather systems of the preceding hour in millimeter
|
// Rain from large scale weather systems of the preceding hour in millimeter
|
||||||
@@ -381,6 +383,7 @@ WeatherProvider.register("openmeteo", {
|
|||||||
currentWeather.rain = parseFloat(weather.hourly[h].rain);
|
currentWeather.rain = parseFloat(weather.hourly[h].rain);
|
||||||
currentWeather.snow = parseFloat(weather.hourly[h].snowfall * 10);
|
currentWeather.snow = parseFloat(weather.hourly[h].snowfall * 10);
|
||||||
currentWeather.precipitationAmount = parseFloat(weather.hourly[h].precipitation);
|
currentWeather.precipitationAmount = parseFloat(weather.hourly[h].precipitation);
|
||||||
|
currentWeather.precipitationProbability = parseFloat(weather.precipitation_probability);
|
||||||
|
|
||||||
return currentWeather;
|
return currentWeather;
|
||||||
},
|
},
|
||||||
@@ -404,6 +407,7 @@ WeatherProvider.register("openmeteo", {
|
|||||||
currentWeather.rain = parseFloat(weather.rain_sum);
|
currentWeather.rain = parseFloat(weather.rain_sum);
|
||||||
currentWeather.snow = parseFloat(weather.snowfall_sum * 10);
|
currentWeather.snow = parseFloat(weather.snowfall_sum * 10);
|
||||||
currentWeather.precipitationAmount = parseFloat(weather.precipitation_sum);
|
currentWeather.precipitationAmount = parseFloat(weather.precipitation_sum);
|
||||||
|
currentWeather.precipitationProbability = parseFloat(weather.precipitation_probability);
|
||||||
|
|
||||||
days.push(currentWeather);
|
days.push(currentWeather);
|
||||||
});
|
});
|
||||||
@@ -437,6 +441,7 @@ WeatherProvider.register("openmeteo", {
|
|||||||
currentWeather.rain = parseFloat(weather.rain);
|
currentWeather.rain = parseFloat(weather.rain);
|
||||||
currentWeather.snow = parseFloat(weather.snowfall * 10);
|
currentWeather.snow = parseFloat(weather.snowfall * 10);
|
||||||
currentWeather.precipitationAmount = parseFloat(weather.precipitation);
|
currentWeather.precipitationAmount = parseFloat(weather.precipitation);
|
||||||
|
currentWeather.precipitationProbability = parseFloat(weather.precipitation_probability);
|
||||||
|
|
||||||
hours.push(currentWeather);
|
hours.push(currentWeather);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user