mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-12-01 02:21:39 +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
@@ -31,6 +31,7 @@ planned for 2026-01-01
|
|||||||
- [ci] Add concurrency to automated tests workflow to cancel outdated runs (#3943)
|
- [ci] Add concurrency to automated tests workflow to cancel outdated runs (#3943)
|
||||||
- [tests] replace `node-libgpiod` with `serialport` in electron-rebuild workflow (#3945)
|
- [tests] replace `node-libgpiod` with `serialport` in electron-rebuild workflow (#3945)
|
||||||
- [calendar] hide repeatingCountTitle if the event count is zero (#3949)
|
- [calendar] hide repeatingCountTitle if the event count is zero (#3949)
|
||||||
|
- [core] configure cspell to check default modules only and fix typos (#3955)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|||||||
@@ -3,19 +3,25 @@
|
|||||||
"language": "en",
|
"language": "en",
|
||||||
"words": [
|
"words": [
|
||||||
"aarch",
|
"aarch",
|
||||||
|
"Adak",
|
||||||
"Alvinger",
|
"Alvinger",
|
||||||
"Ampio",
|
"Ampio",
|
||||||
"andrezibaia",
|
"andrezibaia",
|
||||||
"angeldeejay",
|
"angeldeejay",
|
||||||
|
"apikey",
|
||||||
"apiontek",
|
"apiontek",
|
||||||
"armv",
|
"armv",
|
||||||
"ashishtank",
|
"ashishtank",
|
||||||
"autoplay",
|
"autoplay",
|
||||||
|
"Autorestart",
|
||||||
"beada",
|
"beada",
|
||||||
|
"Behaviour",
|
||||||
"Binney",
|
"Binney",
|
||||||
"bluemanos",
|
"bluemanos",
|
||||||
"bnitkin",
|
"bnitkin",
|
||||||
"bokmål",
|
"bokmål",
|
||||||
|
"bouncyflip",
|
||||||
|
"boxspinner",
|
||||||
"Brasileiro",
|
"Brasileiro",
|
||||||
"Brento",
|
"Brento",
|
||||||
"browserwindow",
|
"browserwindow",
|
||||||
@@ -25,14 +31,22 @@
|
|||||||
"bugsounet",
|
"bugsounet",
|
||||||
"buxxi",
|
"buxxi",
|
||||||
"byday",
|
"byday",
|
||||||
|
"calcage",
|
||||||
|
"calendarfetcher",
|
||||||
"calendarfetcherutils",
|
"calendarfetcherutils",
|
||||||
"calendarutils",
|
"calendarutils",
|
||||||
|
"calevents",
|
||||||
"chamakura",
|
"chamakura",
|
||||||
|
"Citypage",
|
||||||
"cjbrunner",
|
"cjbrunner",
|
||||||
|
"clearsky",
|
||||||
"clientonly",
|
"clientonly",
|
||||||
"clockfaces",
|
"clockfaces",
|
||||||
|
"cloudcover",
|
||||||
"cmdline",
|
"cmdline",
|
||||||
"codac",
|
"codac",
|
||||||
|
"Codrops",
|
||||||
|
"cornerexpand",
|
||||||
"Crazylegstoo",
|
"Crazylegstoo",
|
||||||
"crazyscot",
|
"crazyscot",
|
||||||
"Creepin",
|
"Creepin",
|
||||||
@@ -43,14 +57,23 @@
|
|||||||
"Cymraeg",
|
"Cymraeg",
|
||||||
"dariom",
|
"dariom",
|
||||||
"darksky",
|
"darksky",
|
||||||
|
"dataheaders",
|
||||||
|
"Datamart",
|
||||||
"dateheader",
|
"dateheader",
|
||||||
"dateheaders",
|
"dateheaders",
|
||||||
|
"datekey",
|
||||||
"dathbe",
|
"dathbe",
|
||||||
"davide",
|
"davide",
|
||||||
"DAYAFTERTOMORROW",
|
"DAYAFTERTOMORROW",
|
||||||
"DAYBEFOREYESTERDAY",
|
"DAYBEFOREYESTERDAY",
|
||||||
"defaultmodules",
|
"defaultmodules",
|
||||||
|
"Deificit",
|
||||||
|
"Descr",
|
||||||
|
"dewpoint",
|
||||||
"dgoth",
|
"dgoth",
|
||||||
|
"difflink",
|
||||||
|
"dismissttl",
|
||||||
|
"Displayer",
|
||||||
"dkallen",
|
"dkallen",
|
||||||
"drivelist",
|
"drivelist",
|
||||||
"DTEND",
|
"DTEND",
|
||||||
@@ -63,18 +86,26 @@
|
|||||||
"Edgardos",
|
"Edgardos",
|
||||||
"Ekristoffe",
|
"Ekristoffe",
|
||||||
"elec",
|
"elec",
|
||||||
|
"elif",
|
||||||
"eltociear",
|
"eltociear",
|
||||||
|
"endfor",
|
||||||
|
"endmacro",
|
||||||
"envcanada",
|
"envcanada",
|
||||||
"envsub",
|
"envsub",
|
||||||
"envsubst",
|
"envsubst",
|
||||||
"eouia",
|
"eouia",
|
||||||
|
"Evapotranspration",
|
||||||
"exdate",
|
"exdate",
|
||||||
|
"exdates",
|
||||||
"expectedheaders",
|
"expectedheaders",
|
||||||
|
"exploader",
|
||||||
"ezeholz",
|
"ezeholz",
|
||||||
|
"Fadesteps",
|
||||||
"Faizan",
|
"Faizan",
|
||||||
"feedme",
|
"feedme",
|
||||||
"feelslike",
|
"feelslike",
|
||||||
"Fenner",
|
"Fenner",
|
||||||
|
"Feuchte",
|
||||||
"fewieden",
|
"fewieden",
|
||||||
"fixuppm",
|
"fixuppm",
|
||||||
"flopp",
|
"flopp",
|
||||||
@@ -83,7 +114,9 @@
|
|||||||
"forecastweather",
|
"forecastweather",
|
||||||
"fortawesome",
|
"fortawesome",
|
||||||
"frameguard",
|
"frameguard",
|
||||||
|
"freezinglevel",
|
||||||
"Frysk",
|
"Frysk",
|
||||||
|
"fullarticle",
|
||||||
"fulldate",
|
"fulldate",
|
||||||
"fullday",
|
"fullday",
|
||||||
"fullscreen",
|
"fullscreen",
|
||||||
@@ -92,9 +125,19 @@
|
|||||||
"GHSA",
|
"GHSA",
|
||||||
"ghsas",
|
"ghsas",
|
||||||
"grenagit",
|
"grenagit",
|
||||||
|
"Halfclear",
|
||||||
|
"heavyrain",
|
||||||
|
"heavyrainandthunder",
|
||||||
|
"heavyrainshowers",
|
||||||
|
"heavyrainshowersandthunder",
|
||||||
|
"heavysleet",
|
||||||
|
"heavysleetshowersandthunder",
|
||||||
|
"heavysnow",
|
||||||
|
"heavysnowandthunder",
|
||||||
"Heiko",
|
"Heiko",
|
||||||
"Hirschberger",
|
"Hirschberger",
|
||||||
"hourlyweather",
|
"hourlyweather",
|
||||||
|
"humidex",
|
||||||
"Hwind",
|
"Hwind",
|
||||||
"ical",
|
"ical",
|
||||||
"illimarkangur",
|
"illimarkangur",
|
||||||
@@ -123,15 +166,18 @@
|
|||||||
"Knapoc",
|
"Knapoc",
|
||||||
"Koepke",
|
"Koepke",
|
||||||
"kolbyjack",
|
"kolbyjack",
|
||||||
|
"Komplex",
|
||||||
"krekos",
|
"krekos",
|
||||||
"Kristjan",
|
"Kristjan",
|
||||||
"krukle",
|
"krukle",
|
||||||
"labwc",
|
"labwc",
|
||||||
"Landis",
|
"Landis",
|
||||||
"larryare",
|
"larryare",
|
||||||
|
"Lastberechnung",
|
||||||
"letsencrypt",
|
"letsencrypt",
|
||||||
"libgpiod",
|
"libgpiod",
|
||||||
"Lightspeed",
|
"Lightspeed",
|
||||||
|
"loadingcircle",
|
||||||
"locationforecast",
|
"locationforecast",
|
||||||
"lockstring",
|
"lockstring",
|
||||||
"lstrip",
|
"lstrip",
|
||||||
@@ -159,9 +205,12 @@
|
|||||||
"Ñandú",
|
"Ñandú",
|
||||||
"nathannaveen",
|
"nathannaveen",
|
||||||
"naveensrinivasan",
|
"naveensrinivasan",
|
||||||
|
"nbsp",
|
||||||
"ndom",
|
"ndom",
|
||||||
"Nerfzooka",
|
"Nerfzooka",
|
||||||
"NEWSFEED",
|
"NEWSFEED",
|
||||||
|
"newsfeedfetcher",
|
||||||
|
"newsfetcher",
|
||||||
"newsitems",
|
"newsitems",
|
||||||
"nfogal",
|
"nfogal",
|
||||||
"njwilliams",
|
"njwilliams",
|
||||||
@@ -170,42 +219,61 @@
|
|||||||
"nunjuck",
|
"nunjuck",
|
||||||
"odroid",
|
"odroid",
|
||||||
"oemel",
|
"oemel",
|
||||||
|
"oldconfig",
|
||||||
"onecall",
|
"onecall",
|
||||||
"onevent",
|
"onevent",
|
||||||
"openmeteo",
|
"openmeteo",
|
||||||
|
"openmeto",
|
||||||
"openweathermap",
|
"openweathermap",
|
||||||
"oraclesean",
|
"oraclesean",
|
||||||
"oscarb",
|
"oscarb",
|
||||||
|
"pcat",
|
||||||
"philnagel",
|
"philnagel",
|
||||||
|
"pirateweather",
|
||||||
|
"plained",
|
||||||
"plebcity",
|
"plebcity",
|
||||||
|
"pmax",
|
||||||
|
"pmean",
|
||||||
|
"pmedian",
|
||||||
|
"pmin",
|
||||||
"Português",
|
"Português",
|
||||||
"PRECIP",
|
"PRECIP",
|
||||||
"Problema",
|
"Problema",
|
||||||
"psieg",
|
"psieg",
|
||||||
|
"pubdate",
|
||||||
"radokristof",
|
"radokristof",
|
||||||
"rajniszp",
|
"rajniszp",
|
||||||
"rebuilded",
|
"rebuilded",
|
||||||
"Reis",
|
"Reis",
|
||||||
"rejas",
|
"rejas",
|
||||||
|
"relativehumidity",
|
||||||
"Resig",
|
"Resig",
|
||||||
"roboto",
|
"roboto",
|
||||||
"rohitdharavath",
|
"rohitdharavath",
|
||||||
"Rosso",
|
"Rosso",
|
||||||
|
"Rothfusz",
|
||||||
"rrule",
|
"rrule",
|
||||||
"savvadam",
|
"savvadam",
|
||||||
"sdetweil",
|
"sdetweil",
|
||||||
|
"searchstr",
|
||||||
"sendheaders",
|
"sendheaders",
|
||||||
"serveronly",
|
"serveronly",
|
||||||
"sexualized",
|
"sexualized",
|
||||||
|
"Sitecode",
|
||||||
"skpanagiotis",
|
"skpanagiotis",
|
||||||
"SMHI",
|
"SMHI",
|
||||||
"Snille",
|
"Snille",
|
||||||
|
"snowandthunder",
|
||||||
|
"snowshowersandthunder",
|
||||||
"socketclient",
|
"socketclient",
|
||||||
"socketio",
|
"socketio",
|
||||||
"spectron",
|
"spectron",
|
||||||
"Starinvest",
|
"Starinvest",
|
||||||
|
"stationid",
|
||||||
|
"STEADMAN",
|
||||||
"sthuber",
|
"sthuber",
|
||||||
"Stieber",
|
"Stieber",
|
||||||
|
"strinner",
|
||||||
"stylelintrc",
|
"stylelintrc",
|
||||||
"subclassing",
|
"subclassing",
|
||||||
"sunaction",
|
"sunaction",
|
||||||
@@ -216,22 +284,36 @@
|
|||||||
"tada",
|
"tada",
|
||||||
"taglist",
|
"taglist",
|
||||||
"Teeuw",
|
"Teeuw",
|
||||||
|
"Teil",
|
||||||
"TESTMODE",
|
"TESTMODE",
|
||||||
"thomasrockhu",
|
"thomasrockhu",
|
||||||
|
"thumbslider",
|
||||||
|
"timeformat",
|
||||||
|
"titlereplacestr",
|
||||||
|
"titlesearchstr",
|
||||||
|
"todaytemp",
|
||||||
"tomzt",
|
"tomzt",
|
||||||
|
"trunc",
|
||||||
|
"ttlms",
|
||||||
"ukmetoffice",
|
"ukmetoffice",
|
||||||
"ukmetofficedatahub",
|
"ukmetofficedatahub",
|
||||||
"unitless",
|
"unitless",
|
||||||
|
"unixtime",
|
||||||
"unparseable",
|
"unparseable",
|
||||||
"updatenotification",
|
"updatenotification",
|
||||||
|
"uxdt",
|
||||||
"Vaice",
|
"Vaice",
|
||||||
"veeck",
|
"veeck",
|
||||||
|
"verjaardag",
|
||||||
"VEVENT",
|
"VEVENT",
|
||||||
"vgtu",
|
"vgtu",
|
||||||
|
"Vitest",
|
||||||
"Voelt",
|
"Voelt",
|
||||||
|
"Vorberechnung",
|
||||||
"vppencilsharpener",
|
"vppencilsharpener",
|
||||||
"Wallys",
|
"Wallys",
|
||||||
"Weatherbit",
|
"Weatherbit",
|
||||||
|
"weathercode",
|
||||||
"WEATHERDATA",
|
"WEATHERDATA",
|
||||||
"Weatherflow",
|
"Weatherflow",
|
||||||
"weatherforecast",
|
"weatherforecast",
|
||||||
@@ -239,19 +321,37 @@
|
|||||||
"weathericon",
|
"weathericon",
|
||||||
"weathericons",
|
"weathericons",
|
||||||
"weatherobject",
|
"weatherobject",
|
||||||
|
"weatherprovider",
|
||||||
"weatherutils",
|
"weatherutils",
|
||||||
|
"webcal",
|
||||||
|
"winddirection",
|
||||||
|
"windgusts",
|
||||||
"windspeed",
|
"windspeed",
|
||||||
"Woolridge",
|
"Woolridge",
|
||||||
"worktree",
|
"worktree",
|
||||||
|
"Wsymb",
|
||||||
"xlarge",
|
"xlarge",
|
||||||
|
"xmark",
|
||||||
"xrandr",
|
"xrandr",
|
||||||
"xsmall",
|
"xsmall",
|
||||||
"xsorifc",
|
"xsorifc",
|
||||||
"xwindows",
|
"xwindows",
|
||||||
"xxxe",
|
"xxxe",
|
||||||
"Ybbet",
|
"Ybbet",
|
||||||
|
"yearmatch",
|
||||||
"yearmatchgroup"
|
"yearmatchgroup"
|
||||||
],
|
],
|
||||||
"ignorePaths": ["node_modules/**", "modules/**", "translations/**", "tests/mocks/**", "tests/e2e/modules/clock_es_spec.js", "css/roboto.css"],
|
"ignorePaths": [
|
||||||
|
"css/roboto.css",
|
||||||
|
"node_modules/**",
|
||||||
|
"modules/!(default)/**",
|
||||||
|
"modules/default/**/translations/!(en).json",
|
||||||
|
"modules/default/calendar/windowsZones.json",
|
||||||
|
"modules/default/clock/faces/*.svg",
|
||||||
|
"modules/default/weather/providers/yr.js",
|
||||||
|
"tests/mocks/**",
|
||||||
|
"tests/e2e/modules/clock_es_spec.js",
|
||||||
|
"translations/**"
|
||||||
|
],
|
||||||
"dictionaries": ["node"]
|
"dictionaries": ["node"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
// notice, warning, error, success
|
// notice, warning, error, success
|
||||||
// will add class ns-type-warning, ns-type-error or ns-type-success
|
// will add class ns-type-warning, ns-type-error or ns-type-success
|
||||||
type: "notice",
|
type: "notice",
|
||||||
// if the user doesn´t close the notification then we remove it
|
// if the user doesn't close the notification then we remove it
|
||||||
// after the following time
|
// after the following time
|
||||||
ttl: 6000,
|
ttl: 6000,
|
||||||
al_no: "ns-box",
|
al_no: "ns-box",
|
||||||
|
|||||||
@@ -411,7 +411,7 @@ Module.register("calendar", {
|
|||||||
timeWrapper.innerHTML = CalendarUtils.capFirst(eventStartDateMoment.format(this.config.dateFormat));
|
timeWrapper.innerHTML = CalendarUtils.capFirst(eventStartDateMoment.format(this.config.dateFormat));
|
||||||
// Add end time if showEnd
|
// Add end time if showEnd
|
||||||
if (this.config.showEnd) {
|
if (this.config.showEnd) {
|
||||||
// and has a duation
|
// and has a duration
|
||||||
if (event.startDate !== event.endDate) {
|
if (event.startDate !== event.endDate) {
|
||||||
timeWrapper.innerHTML += "-";
|
timeWrapper.innerHTML += "-";
|
||||||
timeWrapper.innerHTML += CalendarUtils.capFirst(eventEndDateMoment.format(this.config.dateEndFormat));
|
timeWrapper.innerHTML += CalendarUtils.capFirst(eventEndDateMoment.format(this.config.dateEndFormat));
|
||||||
@@ -493,7 +493,7 @@ Module.register("calendar", {
|
|||||||
}
|
}
|
||||||
Log.info("[calendar] event fullday");
|
Log.info("[calendar] event fullday");
|
||||||
} else if (eventStartDateMoment.diff(now, "h") < this.config.getRelative) {
|
} else if (eventStartDateMoment.diff(now, "h") < this.config.getRelative) {
|
||||||
Log.info("[calendar] not full day but within getrelative size");
|
Log.info("[calendar] not full day but within getRelative size");
|
||||||
// If event is within getRelative hours, display 'in xxx' time format or moment.fromNow()
|
// If event is within getRelative hours, display 'in xxx' time format or moment.fromNow()
|
||||||
timeWrapper.innerHTML = `${CalendarUtils.capFirst(eventStartDateMoment.fromNow())}`;
|
timeWrapper.innerHTML = `${CalendarUtils.capFirst(eventStartDateMoment.fromNow())}`;
|
||||||
}
|
}
|
||||||
@@ -721,7 +721,7 @@ Module.register("calendar", {
|
|||||||
}
|
}
|
||||||
events = newEvents;
|
events = newEvents;
|
||||||
}
|
}
|
||||||
Log.info(`[calendar] slicing events total maxcount=${this.config.maximumEntries}`);
|
Log.info(`[calendar] slicing events total maxCount=${this.config.maximumEntries}`);
|
||||||
return events.slice(0, this.config.maximumEntries);
|
return events.slice(0, this.config.maximumEntries);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -909,7 +909,7 @@ Module.register("calendar", {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Broadcasts the events to all other modules for reuse.
|
* Broadcasts the events to all other modules for reuse.
|
||||||
* The all events available in one array, sorted on startdate.
|
* The all events available in one array, sorted on startDate.
|
||||||
*/
|
*/
|
||||||
broadcastEvents () {
|
broadcastEvents () {
|
||||||
const eventList = this.createEventList(false);
|
const eventList = this.createEventList(false);
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ const CalendarFetcherUtils = {
|
|||||||
const geo = event.geo || false;
|
const geo = event.geo || false;
|
||||||
const description = event.description || false;
|
const description = event.description || false;
|
||||||
|
|
||||||
// TODO This should be a seperate function.
|
// TODO This should be a separate function.
|
||||||
if (event.rrule && typeof event.rrule !== "undefined" && !isFacebookBirthday) {
|
if (event.rrule && typeof event.rrule !== "undefined" && !isFacebookBirthday) {
|
||||||
// Recurring event.
|
// Recurring event.
|
||||||
let moments = CalendarFetcherUtils.getMomentsFromRecurringEvent(event, pastLocalMoment, futureLocalMoment, durationMs);
|
let moments = CalendarFetcherUtils.getMomentsFromRecurringEvent(event, pastLocalMoment, futureLocalMoment, durationMs);
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ const CalendarUtils = {
|
|||||||
* @param {string} title The title to transform.
|
* @param {string} title The title to transform.
|
||||||
* @param {object} titleReplace object definition of parts to be replaced in the title
|
* @param {object} titleReplace object definition of parts to be replaced in the title
|
||||||
* object definition:
|
* object definition:
|
||||||
* search: {string,required} RegEx in format //x or simple string to be searched. For (birthday) year calcluation, the element matching the year must be in a RegEx group
|
* search: {string,required} RegEx in format //x or simple string to be searched. For (birthday) year calculation, the element matching the year must be in a RegEx group
|
||||||
* replace: {string,required} Replacement string, may contain match group references (latter is required for year calculation)
|
* replace: {string,required} Replacement string, may contain match group references (latter is required for year calculation)
|
||||||
* yearmatchgroup: {number,optional} match group for year element
|
* yearmatchgroup: {number,optional} match group for year element
|
||||||
* @returns {string} The transformed title.
|
* @returns {string} The transformed title.
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ Module.register("compliments", {
|
|||||||
minute_sync_delay);
|
minute_sync_delay);
|
||||||
},
|
},
|
||||||
|
|
||||||
// check to see if this entry could be a cron entry wich contains spaces
|
// check to see if this entry could be a cron entry which contains spaces
|
||||||
isCronEntry (entry) {
|
isCronEntry (entry) {
|
||||||
return entry.includes(" ");
|
return entry.includes(" ");
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Use ` | safe` to allow html tages within the text string.
|
Use ` | safe` to allow html tags within the text string.
|
||||||
https://mozilla.github.io/nunjucks/templating.html#autoescaping
|
https://mozilla.github.io/nunjucks/templating.html#autoescaping
|
||||||
-->
|
-->
|
||||||
<div>{{ text | safe }}</div>
|
<div>{{ text | safe }}</div>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
{% for name, status in updatesList %}
|
{% for name, status in updatesList %}
|
||||||
<div class="small bright">
|
<div class="small bright">
|
||||||
{% if status.done %}
|
{% if status.done %}
|
||||||
<i class="fas fa-check" style="color: lightgreen;"></i>
|
<i class="fas fa-check" style="color: LightGreen;"></i>
|
||||||
<span>
|
<span>
|
||||||
{% set updateTextLabel = "UPDATE_NOTIFICATION_DONE" %}
|
{% set updateTextLabel = "UPDATE_NOTIFICATION_DONE" %}
|
||||||
{{ updateTextLabel | translate({MODULE_NAME: name}) | safe }}
|
{{ updateTextLabel | translate({MODULE_NAME: name}) | safe }}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* A function to make HTTP requests via the server to avoid CORS-errors.
|
* A function to make HTTP requests via the server to avoid CORS-errors.
|
||||||
* @param {string} url the url to fetch from
|
* @param {string} url the url to fetch from
|
||||||
* @param {string} type what contenttype to expect in the response, can be "json" or "xml"
|
* @param {string} type what content-type to expect in the response, can be "json" or "xml"
|
||||||
* @param {boolean} useCorsProxy A flag to indicate
|
* @param {boolean} useCorsProxy A flag to indicate
|
||||||
* @param {Array.<{name: string, value:string}>} requestHeaders the HTTP headers to send
|
* @param {Array.<{name: string, value:string}>} requestHeaders the HTTP headers to send
|
||||||
* @param {Array.<string>} expectedResponseHeaders the expected HTTP headers to receive
|
* @param {Array.<string>} expectedResponseHeaders the expected HTTP headers to receive
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ WeatherProvider.register("envcanada", {
|
|||||||
* city specified in the Weather module Config information
|
* city specified in the Weather module Config information
|
||||||
*/
|
*/
|
||||||
fetchCommon (target) {
|
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}`);
|
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 fileSuffix = `${this.config.siteCode}_en.xml`; // Build city filename
|
||||||
const nextFile = indexData.body.innerHTML.split(fileSuffix); // Find filename on Index page
|
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
|
// Find the last occurrence
|
||||||
forecastFile = nextFile[nextFile.length - 2].slice(-41) + fileSuffix;
|
forecastFile = nextFile[nextFile.length - 2].slice(-41) + fileSuffix;
|
||||||
forecastFileURL = forecastURL + forecastFile; // Create full URL to the city's weather data
|
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
|
* 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,
|
* 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
|
* 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.
|
* 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
|
* This is required to understand how Min and Max temperature will be determined, and to understand
|
||||||
@@ -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
|
* the next Forecast element should be considered - i.e. look at Today *and* Tonight vs.Tonight-only
|
||||||
*/
|
*/
|
||||||
setMinMaxTemps (weather, foreGroup, today, fullDay, currentTemp) {
|
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 data.time.map((_, index) => Object.keys(data).reduce((row, key) => {
|
||||||
return {
|
return {
|
||||||
...row,
|
...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]
|
[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) {
|
} else if (this.firstEvent && this.firstEvent.location) {
|
||||||
params += `q=${this.firstEvent.location}`;
|
params += `q=${this.firstEvent.location}`;
|
||||||
} else {
|
} else {
|
||||||
// TODO hide doesnt exist!
|
// TODO hide doesn't exist!
|
||||||
this.hide(this.config.animationSpeed, { lockString: this.identifier });
|
this.hide(this.config.animationSpeed, { lockString: this.identifier });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ const OverrideWrapper = Class.extend({
|
|||||||
this.baseProvider.fetchWeatherForecast();
|
this.baseProvider.fetchWeatherForecast();
|
||||||
},
|
},
|
||||||
fetchWeatherHourly () {
|
fetchWeatherHourly () {
|
||||||
this.baseProvider.fetchEatherHourly();
|
this.baseProvider.fetchWeatherHourly();
|
||||||
},
|
},
|
||||||
weatherForecast () {
|
weatherForecast () {
|
||||||
this.baseProvider.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
|
* notificationReceived method with the currentOverrideWeatherObject provided by the
|
||||||
* api provider fetchData implementation.
|
* api provider fetchData implementation.
|
||||||
* @param {WeatherObject} currentWeatherObject - the api provider weather object
|
* @param {WeatherObject} currentWeatherObject - the api provider weather object
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
* - Pressures are in Pascals (Pa)
|
* - Pressures are in Pascals (Pa)
|
||||||
* - Distances are in metres (m)
|
* - Distances are in metres (m)
|
||||||
* - Probabilities and humidity are given as percentages (%)
|
* - 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.
|
* See the PDFs linked above for more information on the data their corresponding units.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ const WeatherProvider = Class.extend({
|
|||||||
/**
|
/**
|
||||||
* A convenience function to make requests.
|
* A convenience function to make requests.
|
||||||
* @param {string} url the url to fetch from
|
* @param {string} url the url to fetch from
|
||||||
* @param {string} type what contenttype to expect in the response, can be "json" or "xml"
|
* @param {string} type what content-type to expect in the response, can be "json" or "xml"
|
||||||
* @param {Array.<{name: string, value:string}>} requestHeaders the HTTP headers to send
|
* @param {Array.<{name: string, value:string}>} requestHeaders the HTTP headers to send
|
||||||
* @param {Array.<string>} expectedResponseHeaders the expected HTTP headers to receive
|
* @param {Array.<string>} expectedResponseHeaders the expected HTTP headers to receive
|
||||||
* @returns {Promise} resolved when the fetch is done
|
* @returns {Promise} resolved when the fetch is done
|
||||||
|
|||||||
Reference in New Issue
Block a user