Added Override Notification Option to Weather Module (#3178)

Fixes #3126 

Added the option `allowOverrideNotification` to `weather.js`. This
allows the module to receive the `CURRENT_WEATHER_OVERRIDE`
notification. The expected payload for this notification is a
full/partial `weatherObject` that is used to supplement/replace the
existing `weatherObject` returned by whichever weather provider is in
use.

No visual changes.

First time contributing - let me know if I've missed something
🙂

---------

Co-authored-by: veeck <michael.veeck@nebenan.de>
This commit is contained in:
NolanKingdon
2023-09-08 01:41:20 -04:00
committed by GitHub
parent 9d49196e69
commit 5cbdd28db3
4 changed files with 122 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
/* global Class, performWebRequest */
/* global Class, performWebRequest, OverrideWrapper */
/* MagicMirror²
* Module: Weather
@@ -164,5 +164,9 @@ WeatherProvider.initialize = function (providerIdentifier, delegate) {
provider.providerName = pi;
}
if (config.allowOverrideNotification) {
return new OverrideWrapper(provider);
}
return provider;
};