From 7a3ea377985bfacd3316e6b6773b4edfc161192b Mon Sep 17 00:00:00 2001 From: Bryan Zhu Date: Mon, 29 Jun 2020 12:44:24 -0400 Subject: [PATCH 01/11] added config option to hide sunrise/sunset in Current Weather module --- CHANGELOG.md | 1 + modules/default/currentweather/currentweather.js | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f77a0769..003437c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ _This release is scheduled to be released on 2020-07-01._ - Added option to config the level of logging - Added prettier for an even cleaner codebase - Hide Sunrise/Sunset in Weather module +- Hide Sunrise/Sunset in Current Weather module - Added Met Office DataHub (UK) provider ### Updated diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index e0f8be50..d9d06ccb 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -23,6 +23,7 @@ Module.register("currentweather", { lang: config.language, decimalSymbol: ".", showHumidity: false, + showSun: true, degreeLabel: false, showIndoorTemperature: false, showIndoorHumidity: false, @@ -155,13 +156,15 @@ Module.register("currentweather", { small.appendChild(humidityIcon); } - var sunriseSunsetIcon = document.createElement("span"); - sunriseSunsetIcon.className = "wi dimmed " + this.sunriseSunsetIcon; - small.appendChild(sunriseSunsetIcon); + if (this.config.showSun) { + var sunriseSunsetIcon = document.createElement("span"); + sunriseSunsetIcon.className = "wi dimmed " + this.sunriseSunsetIcon; + small.appendChild(sunriseSunsetIcon); - var sunriseSunsetTime = document.createElement("span"); - sunriseSunsetTime.innerHTML = " " + this.sunriseSunsetTime; - small.appendChild(sunriseSunsetTime); + var sunriseSunsetTime = document.createElement("span"); + sunriseSunsetTime.innerHTML = " " + this.sunriseSunsetTime; + small.appendChild(sunriseSunsetTime); + } wrapper.appendChild(small); }, From ea31d346494790eeb596f90e590ae96644b980c5 Mon Sep 17 00:00:00 2001 From: ZoneMR Date: Tue, 30 Jun 2020 19:51:25 +0100 Subject: [PATCH 02/11] Fix #2030 - Clock can be off by a minute Set minute/second in our model based on the actual time from moment() rather than our own attempt to track the time - which can drift or fail to respond to time changes. Also, schedule time refreshes to happen 50ms after the minute/second is expected to change - preventing premature fires and rapid re-firings of notifications due to accuracy limits in setTimeout --- modules/default/clock/clock.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/default/clock/clock.js b/modules/default/clock/clock.js index 08dcced0..293ff93b 100644 --- a/modules/default/clock/clock.js +++ b/modules/default/clock/clock.js @@ -51,10 +51,12 @@ Module.register("clock",{ //Calculate how many ms should pass until next update depending on if seconds is displayed or not var delayCalculator = function(reducedSeconds) { + var EXTRA_DELAY = 50; //Deliberate imperceptable delay to prevent off-by-one timekeeping errors + if (self.config.displaySeconds) { - return 1000 - moment().milliseconds(); + return 1000 - moment().milliseconds() + EXTRA_DELAY; } else { - return ((60 - reducedSeconds) * 1000) - moment().milliseconds(); + return ((60 - reducedSeconds) * 1000) - moment().milliseconds() + EXTRA_DELAY; } }; @@ -64,7 +66,7 @@ Module.register("clock",{ //If seconds is displayed CLOCK_SECOND-notification should be sent (but not when CLOCK_MINUTE-notification is sent) if (self.config.displaySeconds) { - self.second = (self.second + 1) % 60; + self.second = moment().second(); if (self.second !== 0) { self.sendNotification("CLOCK_SECOND", self.second); setTimeout(notificationTimer, delayCalculator(0)); @@ -73,7 +75,7 @@ Module.register("clock",{ } //If minute changed or seconds isn't displayed send CLOCK_MINUTE-notification - self.minute = (self.minute + 1) % 60; + self.minute = moment().minute(); self.sendNotification("CLOCK_MINUTE", self.minute); setTimeout(notificationTimer, delayCalculator(0)); }; From c9d0bd2d7f9f019488f0b6f32378970cd66670cb Mon Sep 17 00:00:00 2001 From: Lyubomir Vasilev Date: Wed, 1 Jul 2020 10:08:41 +0300 Subject: [PATCH 03/11] Updated the BG translation --- CHANGELOG.md | 1 + translations/bg.json | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f77a0769..592c7e03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ _This release is scheduled to be released on 2020-07-01._ - Replaced insecure links with https ones - Cleaned up all "no-undef" warnings from eslint - Added location title wrapping for calendar module +- Updated the BG translation ### Deleted diff --git a/translations/bg.json b/translations/bg.json index 786f8643..f6af6c5d 100644 --- a/translations/bg.json +++ b/translations/bg.json @@ -1,10 +1,10 @@ { - "LOADING": "Зареждане …", + "LOADING": "Зареждане на …", "TODAY": "Днес", "TOMORROW": "Утре", "DAYAFTERTOMORROW": "Вдругиден", - "RUNNING": "Свършва на", + "RUNNING": "Свършва след", "EMPTY": "Няма предстоящи събития.", "WEEK": "Седмица {weekNumber}", @@ -26,8 +26,8 @@ "NW": "СЗ", "NNW": "ССЗ", - "UPDATE_NOTIFICATION": "Налична актуализация за MagicMirror².", - "UPDATE_NOTIFICATION_MODULE": "Налична актуализация за {MODULE_NAME} модул.", - "UPDATE_INFO_SINGLE": "Текущата инсталация е изостанала с {COMMIT_COUNT} commit къмита на клон {BRANCH_NAME}.", - "UPDATE_INFO_MULTIPLE": "Текущата инсталация е изостанала с {COMMIT_COUNT} commits къмита на клон {BRANCH_NAME}." -} + "UPDATE_NOTIFICATION": "Налична е актуализация за MagicMirror².", + "UPDATE_NOTIFICATION_MODULE": "Налична е актуализация за модула „{MODULE_NAME}“.", + "UPDATE_INFO_SINGLE": "Инсталираната версия е с {COMMIT_COUNT} ревизия назад от клона „{BRANCH_NAME}“.", + "UPDATE_INFO_MULTIPLE": "Инсталираната версия е с {COMMIT_COUNT} ревизии назад от клона „{BRANCH_NAME}“." +} \ No newline at end of file From 8c0141367b7a6ca0c6fb04e9b85ed3c6851dfef6 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Wed, 1 Jul 2020 19:25:00 +0200 Subject: [PATCH 04/11] Fix EOF issue. --- translations/bg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations/bg.json b/translations/bg.json index f6af6c5d..b48b0a2d 100644 --- a/translations/bg.json +++ b/translations/bg.json @@ -30,4 +30,4 @@ "UPDATE_NOTIFICATION_MODULE": "Налична е актуализация за модула „{MODULE_NAME}“.", "UPDATE_INFO_SINGLE": "Инсталираната версия е с {COMMIT_COUNT} ревизия назад от клона „{BRANCH_NAME}“.", "UPDATE_INFO_MULTIPLE": "Инсталираната версия е с {COMMIT_COUNT} ревизии назад от клона „{BRANCH_NAME}“." -} \ No newline at end of file +} From 5d90a0801162e8628a5b0bfcd39bc0d05b370cfd Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Wed, 1 Jul 2020 19:47:09 +0200 Subject: [PATCH 05/11] Prepare release 2.12.0 --- CHANGELOG.md | 46 ++++++++++++++++++++++++---------------------- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b345e01d..78182857 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,42 +5,44 @@ This project adheres to [Semantic Versioning](https://semver.org/). ❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/donate) With your help we can continue to improve the MagicMirror² -## [2.12.0] - Unreleased (Develop Branch) +## [2.12.0] - 2020-07-01 -_This release is scheduled to be released on 2020-07-01._ +Special thanks to the following contributors: @AndreKoepke, @DarthBrento, @Ekristoffe, @Legion2, @XBCreepinJesus, @ZoneMR, @andrezibaia, @bryanzzhu, @chamakura, @khassel, @ndom91, @radokristof & @rejas. + +ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. ### Added -- Added option to config the level of logging -- Added prettier for an even cleaner codebase -- Hide Sunrise/Sunset in Weather module -- Hide Sunrise/Sunset in Current Weather module -- Added Met Office DataHub (UK) provider +- Added option to config the level of logging. +- Added prettier for an even cleaner codebase. +- Hide Sunrise/Sunset in Weather module. +- Hide Sunrise/Sunset in Current Weather module. +- Added Met Office DataHub (UK) provider. ### Updated -- Cleaned up alert module code -- Cleaned up check_config code -- Replaced grunt-based linters with their non-grunt equivalents -- Switch to most of the eslint:recommended rules and fix warnings -- Replaced insecure links with https ones -- Cleaned up all "no-undef" warnings from eslint -- Added location title wrapping for calendar module -- Updated the BG translation +- Cleaned up alert module code. +- Cleaned up check_config code. +- Replaced grunt-based linters with their non-grunt equivalents. +- Switch to most of the eslint:recommended rules and fix warnings. +- Replaced insecure links with https ones. +- Cleaned up all "no-undef" warnings from eslint. +- Added location title wrapping for calendar module. +- Updated the BG translation. ### Deleted -- Removed truetype (ttf) fonts +- Removed truetype (ttf) fonts. ### Fixed -- The broken modules due to Socket.io change from last release [#1973](https://github.com/MichMich/MagicMirror/issues/1973) -- Add backward compatibility for old module code in socketclient.js [#1973](https://github.com/MichMich/MagicMirror/issues/1973) -- Support multiple instances of calendar module with different config [#1109](https://github.com/MichMich/MagicMirror/issues/1109) -- Fix the use of "maxNumberOfDays" in the module "weatherforecast" [#2018](https://github.com/MichMich/MagicMirror/issues/2018) -- Throw error when check_config fails [#1928](https://github.com/MichMich/MagicMirror/issues/1928) +- The broken modules due to Socket.io change from last release. [#1973](https://github.com/MichMich/MagicMirror/issues/1973) +- Add backward compatibility for old module code in socketclient.js. [#1973](https://github.com/MichMich/MagicMirror/issues/1973) +- Support multiple instances of calendar module with different config. [#1109](https://github.com/MichMich/MagicMirror/issues/1109) +- Fix the use of "maxNumberOfDays" in the module "weatherforecast". [#2018](https://github.com/MichMich/MagicMirror/issues/2018) +- Throw error when check_config fails. [#1928](https://github.com/MichMich/MagicMirror/issues/1928) - Bug fix related to 'maxEntries' not displaying Calendar events. [#2050](https://github.com/MichMich/MagicMirror/issues/2050) -- Updated ical library to latest version [#1926](https://github.com/MichMich/MagicMirror/issues/1926) +- Updated ical library to latest version. [#1926](https://github.com/MichMich/MagicMirror/issues/1926) ## [2.11.0] - 2020-04-01 diff --git a/package-lock.json b/package-lock.json index b29b7ec4..15a6644a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.12.0-develop", + "version": "2.12.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 741d1d2e..5b9562d5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.12.0-develop", + "version": "2.12.0", "description": "The open source modular smart mirror platform.", "main": "js/electron.js", "scripts": { From e16db2233ff29fbc623071d2e8fc050a9c270194 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Wed, 1 Jul 2020 19:52:38 +0200 Subject: [PATCH 06/11] Fix contributor list. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78182857..3b4ee497 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ## [2.12.0] - 2020-07-01 -Special thanks to the following contributors: @AndreKoepke, @DarthBrento, @Ekristoffe, @Legion2, @XBCreepinJesus, @ZoneMR, @andrezibaia, @bryanzzhu, @chamakura, @khassel, @ndom91, @radokristof & @rejas. +Special thanks to the following contributors: @AndreKoepke, @andrezibaia, @bryanzzhu, @chamakura, @DarthBrento, @Ekristoffe, @khassel, @Legion2, @ndom91, @radokristof, @rejas, @XBCreepinJesus & @ZoneMR. ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. From 26ed05ba3a5a2e00b98bf485ee89f861710f1154 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Wed, 1 Jul 2020 20:07:12 +0200 Subject: [PATCH 07/11] Prepare 2.13.0-develop --- CHANGELOG.md | 12 ++++++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b4ee497..069c61f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ This project adheres to [Semantic Versioning](https://semver.org/). ❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/donate) With your help we can continue to improve the MagicMirror² +## [2.13.0] - Unreleased (Develop Branch - Please add your contributions to this release.) + +_This release is scheduled to be released on 2020-10-01._ + +### Added + +### Updated + +### Deleted + +### Fixed + ## [2.12.0] - 2020-07-01 Special thanks to the following contributors: @AndreKoepke, @andrezibaia, @bryanzzhu, @chamakura, @DarthBrento, @Ekristoffe, @khassel, @Legion2, @ndom91, @radokristof, @rejas, @XBCreepinJesus & @ZoneMR. diff --git a/package-lock.json b/package-lock.json index 15a6644a..e421d505 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.12.0", + "version": "2.13.0-develop", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5b9562d5..63d9fcdd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.12.0", + "version": "2.13.0-develop", "description": "The open source modular smart mirror platform.", "main": "js/electron.js", "scripts": { From 0939e405b4019772d4984484761a003da23ff410 Mon Sep 17 00:00:00 2001 From: oemel09 Date: Thu, 2 Jul 2020 20:54:20 +0200 Subject: [PATCH 08/11] Adjusts maxNumberOfDays depending on the endpoint --- modules/default/weatherforecast/weatherforecast.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 83389911..ecda5a53 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -294,7 +294,15 @@ Module.register("weatherforecast", { return; } - params += "&cnt=" + (this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 17 ? 7 : this.config.maxNumberOfDays); + let numberOfDays; + if (this.config.forecastEndpoint === "forecast") { + numberOfDays = (this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 5 ? 5 : this.config.maxNumberOfDays); + // don't get forecasts for the 6th day, as it would not represent the whole day + numberOfDays = numberOfDays * 8 - Math.ceil(new Date().getHours() / 3) % 8; + } else { + numberOfDays = (this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 17) ? 7 : this.config.maxNumberOfDays; + } + params += "&cnt=" + numberOfDays; params += "&units=" + this.config.units; params += "&lang=" + this.config.lang; From 4ed323559058932dd58c012d39757e7fd7cea140 Mon Sep 17 00:00:00 2001 From: oemel09 Date: Thu, 2 Jul 2020 20:56:48 +0200 Subject: [PATCH 09/11] Adds fix to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 069c61f8..68ebc0ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ _This release is scheduled to be released on 2020-10-01._ ### Deleted ### Fixed +- Fix the use of "maxNumberOfDays" in the module "weatherforecast depending on the endpoint (forecast/daily or forecast)". [#2018](https://github.com/MichMich/MagicMirror/issues/2018) ## [2.12.0] - 2020-07-01 From 246dc663c4a82f9f0284de21577f3c24cd7ace9c Mon Sep 17 00:00:00 2001 From: oemel09 Date: Thu, 2 Jul 2020 22:22:04 +0200 Subject: [PATCH 10/11] Applies suggestions from prettier, floor instead of ceil --- modules/default/weatherforecast/weatherforecast.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index ecda5a53..d872ee01 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -296,11 +296,11 @@ Module.register("weatherforecast", { let numberOfDays; if (this.config.forecastEndpoint === "forecast") { - numberOfDays = (this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 5 ? 5 : this.config.maxNumberOfDays); + numberOfDays = this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 5 ? 5 : this.config.maxNumberOfDays; // don't get forecasts for the 6th day, as it would not represent the whole day - numberOfDays = numberOfDays * 8 - Math.ceil(new Date().getHours() / 3) % 8; + numberOfDays = numberOfDays * 8 - (Math.floor(new Date().getHours() / 3) % 8); } else { - numberOfDays = (this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 17) ? 7 : this.config.maxNumberOfDays; + numberOfDays = this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 17 ? 7 : this.config.maxNumberOfDays; } params += "&cnt=" + numberOfDays; From 92cc41dec661f7f8cca593e4da25895c40f7bb4c Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Fri, 3 Jul 2020 21:53:18 +0200 Subject: [PATCH 11/11] Fix linting issue. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68ebc0ea..66c307c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ _This release is scheduled to be released on 2020-10-01._ ### Deleted ### Fixed + - Fix the use of "maxNumberOfDays" in the module "weatherforecast depending on the endpoint (forecast/daily or forecast)". [#2018](https://github.com/MichMich/MagicMirror/issues/2018) ## [2.12.0] - 2020-07-01