mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
Fix rounding in precipitation percentage (#3045)
Percentage should be always rounded so that we dont get something like "47.0000000001 %" Some small typo and naming fixes also while I am here --------- Co-authored-by: veeck <michael@veeck.de>
This commit is contained in:
@@ -145,9 +145,9 @@ WeatherProvider.register("openweathermap", {
|
||||
*/
|
||||
generateWeatherObjectsFromForecast(forecasts) {
|
||||
if (this.config.weatherEndpoint === "/forecast") {
|
||||
return this.fetchForecastHourly(forecasts);
|
||||
return this.generateForecastHourly(forecasts);
|
||||
} else if (this.config.weatherEndpoint === "/forecast/daily") {
|
||||
return this.fetchForecastDaily(forecasts);
|
||||
return this.generateForecastDaily(forecasts);
|
||||
}
|
||||
// if weatherEndpoint does not match forecast or forecast/daily, what should be returned?
|
||||
return [new WeatherObject()];
|
||||
@@ -165,9 +165,10 @@ WeatherProvider.register("openweathermap", {
|
||||
},
|
||||
|
||||
/*
|
||||
* fetch forecast information for 3-hourly forecast (available for free subscription).
|
||||
* Generate forecast information for 3-hourly forecast (available for free
|
||||
* subscription).
|
||||
*/
|
||||
fetchForecastHourly(forecasts) {
|
||||
generateForecastHourly(forecasts) {
|
||||
// initial variable declaration
|
||||
const days = [];
|
||||
// variables for temperature range and rain
|
||||
@@ -238,9 +239,10 @@ WeatherProvider.register("openweathermap", {
|
||||
},
|
||||
|
||||
/*
|
||||
* fetch forecast information for daily forecast (available for paid subscription or old apiKey).
|
||||
* Generate forecast information for daily forecast (available for paid
|
||||
* subscription or old apiKey).
|
||||
*/
|
||||
fetchForecastDaily(forecasts) {
|
||||
generateForecastDaily(forecasts) {
|
||||
// initial variable declaration
|
||||
const days = [];
|
||||
|
||||
|
Reference in New Issue
Block a user