mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-12-12 09:52:37 +00:00
[core] configure cspell to check default modules only and fix typos (#3955)
When I saw PR #3951, I wondered why `cspell` didn't catch these typos before. Unfortunately, the default modules were excluded from the check. I have corrected this with these changes. This even revealed a code error in `modules/default/weather/providers/overrideWrapper.js`: - before: `fetchEatherHourly` - after: `fetchWeatherHourly`
This commit is contained in:
committed by
GitHub
parent
8e9ee8953a
commit
2b08288346
@@ -101,7 +101,7 @@ WeatherProvider.register("envcanada", {
|
||||
* city specified in the Weather module Config information
|
||||
*/
|
||||
fetchCommon (target) {
|
||||
const forecastURL = this.getUrl(); // Get the approriate URL for the MSC Datamart Index page
|
||||
const forecastURL = this.getUrl(); // Get the appropriate URL for the MSC Datamart Index page
|
||||
|
||||
Log.debug(`[weatherprovider.envcanada] ${target} Index url: ${forecastURL}`);
|
||||
|
||||
@@ -127,7 +127,7 @@ WeatherProvider.register("envcanada", {
|
||||
const fileSuffix = `${this.config.siteCode}_en.xml`; // Build city filename
|
||||
const nextFile = indexData.body.innerHTML.split(fileSuffix); // Find filename on Index page
|
||||
|
||||
if (nextFile.length > 1) { // Parse out the full unqiue file city filename
|
||||
if (nextFile.length > 1) { // Parse out the full unique file city filename
|
||||
// Find the last occurrence
|
||||
forecastFile = nextFile[nextFile.length - 2].slice(-41) + fileSuffix;
|
||||
forecastFileURL = forecastURL + forecastFile; // Create full URL to the city's weather data
|
||||
@@ -325,7 +325,7 @@ WeatherProvider.register("envcanada", {
|
||||
* off and Element 0 will contain Current Tonight. From there, the next 5 days will be contained in
|
||||
* Elements 1/2, 3/4, 5/6, 7/8, and 9/10. As well, Element 11 will contain a forecast for a 6th day,
|
||||
* but only for the Today portion (not Tonight). This module will create a 6-day forecast using
|
||||
* Elements 0 to 11, and will ignore the additional Todat forecast in Element 11.
|
||||
* Elements 0 to 11, and will ignore the additional Today forecast in Element 11.
|
||||
*
|
||||
* We need to determine if Element 0 is showing the forecast for Current Today or Current Tonight.
|
||||
* This is required to understand how Min and Max temperature will be determined, and to understand
|
||||
@@ -431,7 +431,7 @@ WeatherProvider.register("envcanada", {
|
||||
|
||||
/*
|
||||
* The EC hourly forecast is held in a 24-element array - Elements 0 to 23 - with Element 0 holding
|
||||
* the forecast for the next 'on the hour' timeslot. This means the array is a rolling 24 hours.
|
||||
* the forecast for the next 'on the hour' time slot. This means the array is a rolling 24 hours.
|
||||
*/
|
||||
const hourGroup = ECdoc.querySelectorAll("siteData hourlyForecastGroup hourlyForecast");
|
||||
|
||||
@@ -464,7 +464,7 @@ WeatherProvider.register("envcanada", {
|
||||
},
|
||||
|
||||
/*
|
||||
* Determine Min and Max temp based on a supplied Forecast Element index and a boolen that denotes if
|
||||
* Determine Min and Max temp based on a supplied Forecast Element index and a boolean that denotes if
|
||||
* the next Forecast element should be considered - i.e. look at Today *and* Tonight vs.Tonight-only
|
||||
*/
|
||||
setMinMaxTemps (weather, foreGroup, today, fullDay, currentTemp) {
|
||||
|
||||
@@ -296,7 +296,7 @@ WeatherProvider.register("openmeteo", {
|
||||
return data.time.map((_, index) => Object.keys(data).reduce((row, key) => {
|
||||
return {
|
||||
...row,
|
||||
// Parse time values as momentjs instances
|
||||
// Parse time values as moment.js instances
|
||||
[key]: ["time", "sunrise", "sunset"].includes(key) ? this.checkDST(data[key][index]) : data[key][index]
|
||||
};
|
||||
}, {}));
|
||||
|
||||
@@ -427,7 +427,7 @@ WeatherProvider.register("openweathermap", {
|
||||
} else if (this.firstEvent && this.firstEvent.location) {
|
||||
params += `q=${this.firstEvent.location}`;
|
||||
} else {
|
||||
// TODO hide doesnt exist!
|
||||
// TODO hide doesn't exist!
|
||||
this.hide(this.config.animationSpeed, { lockString: this.identifier });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ const OverrideWrapper = Class.extend({
|
||||
this.baseProvider.fetchWeatherForecast();
|
||||
},
|
||||
fetchWeatherHourly () {
|
||||
this.baseProvider.fetchEatherHourly();
|
||||
this.baseProvider.fetchWeatherHourly();
|
||||
},
|
||||
weatherForecast () {
|
||||
this.baseProvider.weatherForecast();
|
||||
@@ -84,7 +84,7 @@ const OverrideWrapper = Class.extend({
|
||||
},
|
||||
|
||||
/**
|
||||
* Override to combine the overrideWeatherObejct provided in the
|
||||
* Override to combine the overrideWeatherObject provided in the
|
||||
* notificationReceived method with the currentOverrideWeatherObject provided by the
|
||||
* api provider fetchData implementation.
|
||||
* @param {WeatherObject} currentWeatherObject - the api provider weather object
|
||||
|
||||
@@ -141,7 +141,7 @@ WeatherProvider.register("smhi", {
|
||||
|
||||
/*
|
||||
* Determine the precipitation amount and category and update the
|
||||
* weatherObject with it, the valuetype to use can be configured or uses
|
||||
* weatherObject with it, the value type to use can be configured or uses
|
||||
* median as default.
|
||||
*/
|
||||
let precipitationValue = this.paramValue(weatherData, this.config.precipitationValue);
|
||||
@@ -173,7 +173,7 @@ WeatherProvider.register("smhi", {
|
||||
* @param {object[]} allWeatherData Array of weatherdata
|
||||
* @param {object} coordinates Coordinates of the locations of the weather
|
||||
* @param {string} groupBy The interval to use for grouping the data (day, hour)
|
||||
* @returns {WeatherObject[]} Array of weatherobjects
|
||||
* @returns {WeatherObject[]} Array of weather objects
|
||||
*/
|
||||
convertWeatherDataGroupedBy (allWeatherData, coordinates, groupBy = "day") {
|
||||
let currentWeather;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
* - Pressures are in Pascals (Pa)
|
||||
* - Distances are in metres (m)
|
||||
* - Probabilities and humidity are given as percentages (%)
|
||||
* - Precipitation is measured in millimetres (mm) with rates per hour (mm/h)
|
||||
* - Precipitation is measured in millimeters (mm) with rates per hour (mm/h)
|
||||
*
|
||||
* See the PDFs linked above for more information on the data their corresponding units.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user