mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
use short if in weatherforecast.js, add comment to logger.js
This commit is contained in:
@@ -340,12 +340,8 @@ Module.register("weatherforecast", {
|
||||
* argument data object - Weather information received form openweather.org.
|
||||
*/
|
||||
processWeather: function (data, momenttz) {
|
||||
let mom;
|
||||
if (momenttz === null) {
|
||||
mom = moment;
|
||||
} else {
|
||||
mom = momenttz;
|
||||
}
|
||||
let mom = momenttz ? momenttz : moment; // Exception last.
|
||||
|
||||
// Forcast16 (paid) API endpoint provides this data. Onecall endpoint
|
||||
// does not.
|
||||
if (data.city) {
|
||||
@@ -489,12 +485,8 @@ Module.register("weatherforecast", {
|
||||
* This code finds all forecasts that is for the same day and sums the amount of rain and returns that.
|
||||
*/
|
||||
processRain: function (forecast, allForecasts, momenttz) {
|
||||
let mom;
|
||||
if (momenttz === null) {
|
||||
mom = moment;
|
||||
} else {
|
||||
mom = momenttz;
|
||||
}
|
||||
let mom = momenttz ? momenttz : moment; // Exception last.
|
||||
|
||||
//If the amount of rain actually is a number, return it
|
||||
if (!isNaN(forecast.rain)) {
|
||||
return forecast.rain;
|
||||
|
Reference in New Issue
Block a user