mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-29 12:39:45 +00:00
Use isDayTime method
This commit is contained in:
parent
a7684e3e9f
commit
43eb760bce
@ -158,17 +158,12 @@ WeatherProvider.register("weathergov", {
|
|||||||
currentWeather.precipitation = this.convertLength(currentWeatherData.precipitationLastHour.value);
|
currentWeather.precipitation = this.convertLength(currentWeatherData.precipitationLastHour.value);
|
||||||
currentWeather.feelsLikeTemp = this.convertTemp(currentWeatherData.heatIndex.value);
|
currentWeather.feelsLikeTemp = this.convertTemp(currentWeatherData.heatIndex.value);
|
||||||
|
|
||||||
let isDaytime = true;
|
|
||||||
if (currentWeatherData.icon.includes("day")) {
|
|
||||||
isDaytime = true;
|
|
||||||
} else {
|
|
||||||
isDaytime = false;
|
|
||||||
}
|
|
||||||
currentWeather.weatherType = this.convertWeatherType(currentWeatherData.textDescription, isDaytime);
|
|
||||||
|
|
||||||
// determine the sunrise/sunset times - not supplied in weather.gov data
|
// determine the sunrise/sunset times - not supplied in weather.gov data
|
||||||
currentWeather.updateSunTime(this.config.lat, this.config.lon);
|
currentWeather.updateSunTime(this.config.lat, this.config.lon);
|
||||||
|
|
||||||
|
// update weatherType
|
||||||
|
currentWeather.weatherType = this.convertWeatherType(currentWeatherData.textDescription, currentWeather.isDayTime());
|
||||||
|
|
||||||
return currentWeather;
|
return currentWeather;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user