Skip to content
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Thanks to: @Crazylegstoo, @dathbe, @m-idler, @plebcity, @khassel, @KristjanESPER
- Improve test reliability and maintainability
- [tests] add alert module tests for different welcome_message configurations (#3867)
- [lint-staged] use `prettier --write --ignore-unknown` in `lint-staged` to avoid errors on unsupported files (#3888)
- [weatherprovider] update override warning wording (#3914)

### Updated

Expand Down
1 change: 0 additions & 1 deletion cspell.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@
"sthuber",
"Stieber",
"stylelintrc",
"subclassing",
"sunaction",
"suncalc",
"suntimes",
Expand Down
24 changes: 12 additions & 12 deletions js/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
const Module = Class.extend({

/**
********************************************************
* All methods (and properties) below can be subclassed. *
********************************************************
*********************************************************
* All methods (and properties) below can be overridden. *
*********************************************************
*/

// Set the minimum MagicMirror² module version for this module.
Expand Down Expand Up @@ -76,8 +76,8 @@ const Module = Class.extend({

/**
* Generates the dom which needs to be displayed. This method is called by the MagicMirror² core.
* This method can to be subclassed if the module wants to display info on the mirror.
* Alternatively, the getTemplate method could be subclassed.
* This method can to be overridden if the module wants to display info on the mirror.
* Alternatively, the getTemplate method could be overridden.
* @returns {HTMLElement|Promise} The dom or a promise with the dom to display.
*/
getDom () {
Expand Down Expand Up @@ -110,7 +110,7 @@ const Module = Class.extend({
/**
* Generates the header string which needs to be displayed if a user has a header configured for this module.
* This method is called by the MagicMirror² core, but only if the user has configured a default header for the module.
* This method needs to be subclassed if the module wants to display modified headers on the mirror.
* This method needs to be overridden if the module wants to display modified headers on the mirror.
* @returns {string} The header to display above the header.
*/
getHeader () {
Expand All @@ -119,8 +119,8 @@ const Module = Class.extend({

/**
* Returns the template for the module which is used by the default getDom implementation.
* This method needs to be subclassed if the module wants to use a template.
* It can either return a template sting, or a template filename.
* This method needs to be overridden if the module wants to use a template.
* It can either return a template string, or a template filename.
* If the string ends with '.html' it's considered a file from within the module's folder.
* @returns {string} The template string of filename.
*/
Expand All @@ -130,7 +130,7 @@ const Module = Class.extend({

/**
* Returns the data to be used in the template.
* This method needs to be subclassed if the module wants to use a custom data.
* This method needs to be overridden if the module wants to use a custom data.
* @returns {object} The data for the template
*/
getTemplateData () {
Expand Down Expand Up @@ -197,9 +197,9 @@ const Module = Class.extend({
},

/**
********************************************
* The methods below don't need subclassing. *
********************************************
***********************************************
* The methods below should not be overridden. *
***********************************************
*/

/**
Expand Down
6 changes: 3 additions & 3 deletions modules/default/weather/weatherprovider.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ const WeatherProvider = Class.extend({
// This method should start the API request to fetch the current weather.
// This method should definitely be overwritten in the provider.
fetchCurrentWeather () {
Log.warn(`Weather provider: ${this.providerName} does not subclass the fetchCurrentWeather method.`);
Log.warn(`Weather provider: ${this.providerName} does not override the fetchCurrentWeather method.`);
},

// This method should start the API request to fetch the weather forecast.
// This method should definitely be overwritten in the provider.
fetchWeatherForecast () {
Log.warn(`Weather provider: ${this.providerName} does not subclass the fetchWeatherForecast method.`);
Log.warn(`Weather provider: ${this.providerName} does not override the fetchWeatherForecast method.`);
},

// This method should start the API request to fetch the weather hourly.
// This method should definitely be overwritten in the provider.
fetchWeatherHourly () {
Log.warn(`Weather provider: ${this.providerName} does not subclass the fetchWeatherHourly method.`);
Log.warn(`Weather provider: ${this.providerName} does not override the fetchWeatherHourly method.`);
},

// This returns a WeatherDay object for the current weather.
Expand Down