From 5b6b1c16166a0871a840a3abcded2e0b784e3c29 Mon Sep 17 00:00:00 2001 From: "Kevin G." Date: Sat, 18 Oct 2025 19:29:14 -0400 Subject: [PATCH 1/3] Fix forecast URL and wind speed logic Updated the forecast URL format and improved wind speed handling. --- modules/default/weather/providers/envcanada.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/default/weather/providers/envcanada.js b/modules/default/weather/providers/envcanada.js index cf397c55aa..84fb02b956 100644 --- a/modules/default/weather/providers/envcanada.js +++ b/modules/default/weather/providers/envcanada.js @@ -208,7 +208,7 @@ WeatherProvider.register("envcanada", { * Fixed value + Prov code specified in Weather module Config.js + current hour as GMT */ getUrl () { - let forecastURL = `https://dd.weather.gc.ca/citypage_weather/${this.config.provCode}`; + let forecastURL = `https://dd.weather.gc.ca/today/citypage_weather/${this.config.provCode}`; const hour = this.getCurrentHourGMT(); forecastURL += `/${hour}/`; return forecastURL; @@ -243,8 +243,13 @@ WeatherProvider.register("envcanada", { } else { currentWeather.temperature = this.cacheCurrentTemp; } + + if (ECdoc.querySelector("siteData currentConditions wind speed").textContent === "calm") { + currentWeather.windSpeed = "0"; + } else { + currentWeather.windSpeed = WeatherUtils.convertWindToMs(ECdoc.querySelector("siteData currentConditions wind speed").textContent); + } - currentWeather.windSpeed = WeatherUtils.convertWindToMs(ECdoc.querySelector("siteData currentConditions wind speed").textContent); currentWeather.windFromDirection = ECdoc.querySelector("siteData currentConditions wind bearing").textContent; currentWeather.humidity = ECdoc.querySelector("siteData currentConditions relativeHumidity").textContent; From 849d9e5c4231ea835350bf19481281676e5c4811 Mon Sep 17 00:00:00 2001 From: "Kevin G." Date: Sat, 18 Oct 2025 19:42:34 -0400 Subject: [PATCH 2/3] Fix Environment Canada weather URL and windspeed Fixed Environment Canada weather URL and windspeed conversion. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab0eb781b0..4942c69abe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ planned for 2026-01-01 - feat: add ESlint rule `no-sparse-arrays` for config check to fix #3910 (#3911) - fixed eslint warnings shown in #3911 and updated npm publish docs (#3913) - [core] refactor: replace `express-ipfilter` with lightweight custom middleware (#3917) - This fixes security issue [CVE-2023-42282](https://github.com/advisories/GHSA-78xj-cgh5-2h22), which is not very likely to be exploitable in MagicMirror² setups, but still should be fixed. +- fixed the Environment Canada weather URL (#3912) and now converts a windspeed of 'calm' to 0 ### Updated From 657afd7e705e94519054d66d68cc55aea3967a11 Mon Sep 17 00:00:00 2001 From: "Kevin G." Date: Sat, 18 Oct 2025 19:53:24 -0400 Subject: [PATCH 3/3] Fix formatting error (trailing blank) --- modules/default/weather/providers/envcanada.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/weather/providers/envcanada.js b/modules/default/weather/providers/envcanada.js index 84fb02b956..43d57da67f 100644 --- a/modules/default/weather/providers/envcanada.js +++ b/modules/default/weather/providers/envcanada.js @@ -243,7 +243,7 @@ WeatherProvider.register("envcanada", { } else { currentWeather.temperature = this.cacheCurrentTemp; } - + if (ECdoc.querySelector("siteData currentConditions wind speed").textContent === "calm") { currentWeather.windSpeed = "0"; } else {