Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 7 additions & 2 deletions modules/default/weather/providers/envcanada.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -244,7 +244,12 @@ WeatherProvider.register("envcanada", {
currentWeather.temperature = this.cacheCurrentTemp;
}

currentWeather.windSpeed = WeatherUtils.convertWindToMs(ECdoc.querySelector("siteData currentConditions wind speed").textContent);
if (ECdoc.querySelector("siteData currentConditions wind speed").textContent === "calm") {
Comment thread
rejas marked this conversation as resolved.
currentWeather.windSpeed = "0";
} else {
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;
Expand Down