Added outgoing notification

This commit is contained in:
eouia
2022-04-26 13:55:39 +02:00
parent 439690b981
commit df0f048ecc
3 changed files with 25 additions and 0 deletions

View File

@@ -154,6 +154,15 @@ Module.register("weather", {
if (this.weatherProvider.currentWeather()) {
this.sendNotification("CURRENTWEATHER_TYPE", { type: this.weatherProvider.currentWeather().weatherType.replace("-", "_") });
}
let notificationPayload = {
current: this.weatherProvider?.currentWeatherObject?.simpleClone() ?? null,
forecast: this.weatherProvider?.weatherForecastArray?.map((ar) => ar.simpleClone()) ?? [],
hourly: this.weatherProvider?.weatherHourlyArray?.map((ar) => ar.simpleClone()) ?? [],
location: this.weatherProvider?.fetchedLocationName,
provider: this.weatherProvider.providerName
};
this.sendNotification("WEATHER_UPDATED", notificationPayload);
},
scheduleUpdate: function (delay = null) {