From b52da7c9fc06b9de05dd8f7018d933c5047588b3 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Tue, 1 Jan 2019 17:15:37 +0100 Subject: [PATCH 001/116] Prepare for 2.7.0 dev branch. --- 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 cee21d56..b990c080 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ This project adheres to [Semantic Versioning](http://semver.org/). --- +## [2.7.0] - Unreleased + +*This release is scheduled to be released on 2019-04-01.* + +### Added + +### Updated + +### Fixed + ## [2.6.0] - 2019-01-01 ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. If you are having issues updating, make sure you are running the latest version of Node. @@ -12,6 +22,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### ✨ Experimental ✨ - New default [module weather](modules/default/weather). This module will eventually replace the current `currentweather` and `weatherforecast` modules. The new module is still pretty experimental, but it's included so you can give it a try and help us improve this module. Please give us you feedback using [this forum post](https://forum.magicmirror.builders/topic/9335/default-weather-module-refactoring). +A huge, huge, huge thanks to user @fewieden for all his hard work on the new `weather` module! + ### Added - Possibility to add classes to the cell of symbol, title and time of the events of calendar. - Font-awesome 5, still has 4 for backwards compatibility. diff --git a/package-lock.json b/package-lock.json index 281f5ada..7e37e07b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.6.0", + "version": "2.7.0-develop", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4c8f24dd..5a657153 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.6.0", + "version": "2.7.0-develop", "description": "The open source modular smart mirror platform.", "main": "js/electron.js", "scripts": { From 3541d5addee28810417c1d32753e8508d73ca08a Mon Sep 17 00:00:00 2001 From: fwitte Date: Thu, 3 Jan 2019 12:06:52 +0100 Subject: [PATCH 002/116] removed degree symbol display for Kelvin scale, match source code in currentweather and weatherforecast --- modules/default/currentweather/currentweather.js | 12 ++++++------ modules/default/weatherforecast/weatherforecast.js | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 18ae3c71..7285bd2e 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -201,13 +201,13 @@ Module.register("currentweather",{ if (this.config.degreeLabel) { switch (this.config.units ) { case "metric": - degreeLabel = "C"; + degreeLabel = " °C"; break; case "imperial": - degreeLabel = "F"; + degreeLabel = " °F"; break; case "default": - degreeLabel = "K"; + degreeLabel = " K"; break; } } @@ -218,7 +218,7 @@ Module.register("currentweather",{ var temperature = document.createElement("span"); temperature.className = "bright"; - temperature.innerHTML = " " + this.temperature.replace(".", this.config.decimalSymbol) + "°" + degreeLabel; + temperature.innerHTML = " " + this.temperature.replace(".", this.config.decimalSymbol) + degreeLabel; large.appendChild(temperature); if (this.config.showIndoorTemperature && this.indoorTemperature) { @@ -228,7 +228,7 @@ Module.register("currentweather",{ var indoorTemperatureElem = document.createElement("span"); indoorTemperatureElem.className = "bright"; - indoorTemperatureElem.innerHTML = " " + this.indoorTemperature.replace(".", this.config.decimalSymbol) + "°" + degreeLabel; + indoorTemperatureElem.innerHTML = " " + this.indoorTemperature.replace(".", this.config.decimalSymbol) + degreeLabel; large.appendChild(indoorTemperatureElem); } @@ -251,7 +251,7 @@ Module.register("currentweather",{ var feelsLike = document.createElement("span"); feelsLike.className = "dimmed"; - feelsLike.innerHTML = this.translate("FEELS") + " " + this.feelsLike + "°" + degreeLabel; + feelsLike.innerHTML = this.translate("FEELS") + " " + this.feelsLike + degreeLabel; small.appendChild(feelsLike); wrapper.appendChild(small); diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index a29abc16..3afc7f74 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -142,17 +142,17 @@ Module.register("weatherforecast",{ icon.className = "wi weathericon " + forecast.icon; iconCell.appendChild(icon); - var degreeLabel = "°"; + var degreeLabel = ""; if(this.config.scale) { switch(this.config.units) { case "metric": - degreeLabel += " C"; + degreeLabel = " °C"; break; case "imperial": - degreeLabel += " F"; + degreeLabel = " °F"; break; case "default": - degreeLabel = "K"; + degreeLabel = " K"; break; } } From c8f53bdf8e70a9c946e35691f60c72e690b8569c Mon Sep 17 00:00:00 2001 From: fwitte Date: Thu, 3 Jan 2019 12:35:52 +0100 Subject: [PATCH 003/116] updated CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b990c080..bef62f33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Updated ### Fixed +- Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503). ## [2.6.0] - 2019-01-01 From e1fe8d1d89a96fd039ff5411d03aa3e5a3ac2452 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Thu, 3 Jan 2019 16:04:33 +0100 Subject: [PATCH 004/116] Bump Electron to v3.0.13 - Issue: #1500 --- CHANGELOG.md | 3 + package-lock.json | 711 ++++++++++++++++++++++------------------------ package.json | 2 +- 3 files changed, 344 insertions(+), 372 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bef62f33..d47f3fa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,9 +9,12 @@ This project adheres to [Semantic Versioning](http://semver.org/). *This release is scheduled to be released on 2019-04-01.* +ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. If you are having issues running Electron, make sure your [Raspbian is up to date](https://www.raspberrypi.org/documentation/raspbian/updating.md). + ### Added ### Updated +- Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) ### Fixed - Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503). diff --git a/package-lock.json b/package-lock.json index 7e37e07b..124aa864 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,63 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "@octokit/rest": { "version": "14.0.5", "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-14.0.5.tgz", @@ -85,13 +142,10 @@ } }, "acorn-jsx": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-4.1.1.tgz", - "integrity": "sha512-JY+iV6r+cO21KtntVvFkD+iqjtdpRUpGqKWgfkCdZq1R+kbreEl8EcdcJR4SmiIgsIQT33s6QzheQ9a275Q8xw==", - "dev": true, - "requires": { - "acorn": "^5.0.3" - } + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", + "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", + "dev": true }, "after": { "version": "0.8.2", @@ -395,6 +449,12 @@ "integrity": "sha1-E8pRXYYgbaC6xm6DTdOX2HWBCUw=", "dev": true }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", @@ -441,17 +501,6 @@ "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==" }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - } - }, "babel-polyfill": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", @@ -1225,9 +1274,9 @@ }, "dependencies": { "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", "dev": true } } @@ -1470,24 +1519,6 @@ "integrity": "sha512-VIPwiMJqJ13ZQfaCsIFnp5Me9tnjURiaIFxfz7EH0Ci0dTSQpZtSLrqOicXqEd/z2r+z+Klk9GzmnRsgpgbOsQ==", "dev": true }, - "define-properties": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", - "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", - "dev": true, - "requires": { - "foreach": "^2.0.5", - "object-keys": "^1.0.8" - }, - "dependencies": { - "object-keys": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", - "dev": true - } - } - }, "del": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", @@ -1663,12 +1694,12 @@ "dev": true }, "electron": { - "version": "2.0.16", - "resolved": "https://registry.npmjs.org/electron/-/electron-2.0.16.tgz", - "integrity": "sha512-mlC91VDuBU8x9tdGGISznrBCsnPKO1tBskXtBQhceBt0zWUZtV6eURVF5RaY5QK5Q+eBzVJbFT4+LUVupNwhSg==", + "version": "3.0.13", + "resolved": "https://registry.npmjs.org/electron/-/electron-3.0.13.tgz", + "integrity": "sha512-tfx5jFgXhCmpe6oPjcesaRj7geHqQxrJdbpseanRzL9BbyYUtsj0HoxwPAUvCx4+52P6XryBwWTvne/1eBVf9Q==", "requires": { "@types/node": "^8.0.24", - "electron-download": "^3.0.1", + "electron-download": "^4.1.0", "extract-zip": "^1.0.3" } }, @@ -1727,19 +1758,39 @@ } }, "electron-download": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/electron-download/-/electron-download-3.3.0.tgz", - "integrity": "sha1-LP1U1pZsAZxNSa1l++Zcyc3vaMg=", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/electron-download/-/electron-download-4.1.1.tgz", + "integrity": "sha512-FjEWG9Jb/ppK/2zToP+U5dds114fM1ZOJqMAR4aXXL5CvyPE9fiqBK/9YcwC9poIFQTEJk/EM/zyRwziziRZrg==", "requires": { - "debug": "^2.2.0", - "fs-extra": "^0.30.0", - "home-path": "^1.0.1", + "debug": "^3.0.0", + "env-paths": "^1.0.0", + "fs-extra": "^4.0.1", "minimist": "^1.2.0", - "nugget": "^2.0.0", - "path-exists": "^2.1.0", - "rc": "^1.1.2", - "semver": "^5.3.0", - "sumchecker": "^1.2.0" + "nugget": "^2.0.1", + "path-exists": "^3.0.0", + "rc": "^1.2.1", + "semver": "^5.4.1", + "sumchecker": "^2.0.2" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + } } }, "electron-to-chromium": { @@ -1843,8 +1894,7 @@ "env-paths": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-1.0.0.tgz", - "integrity": "sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA=", - "dev": true + "integrity": "sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA=" }, "error-ex": { "version": "1.3.1", @@ -1854,34 +1904,11 @@ "is-arrayish": "^0.2.1" } }, - "es-abstract": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", - "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", - "dev": true, - "requires": { - "es-to-primitive": "^1.1.1", - "function-bind": "^1.1.1", - "has": "^1.0.1", - "is-callable": "^1.1.3", - "is-regex": "^1.0.4" - } - }, - "es-to-primitive": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", - "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", - "dev": true, - "requires": { - "is-callable": "^1.1.1", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.1" - } - }, "es6-promise": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.2.tgz", - "integrity": "sha512-LSas5vsuA6Q4nEdf9wokY5/AJYXry98i0IzXsv49rYsgDGDNDPbqAYR1Pe23iFxygfbGZNR/5VrHXBCh2BhvUQ==" + "integrity": "sha512-LSas5vsuA6Q4nEdf9wokY5/AJYXry98i0IzXsv49rYsgDGDNDPbqAYR1Pe23iFxygfbGZNR/5VrHXBCh2BhvUQ==", + "dev": true }, "es6-promisify": { "version": "5.0.0", @@ -1931,32 +1958,31 @@ } }, "eslint": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.1.0.tgz", - "integrity": "sha512-DyH6JsoA1KzA5+OSWFjg56DFJT+sDLO0yokaPZ9qY0UEmYrPA1gEX/G1MnVkmRDsksG4H1foIVz2ZXXM3hHYvw==", + "version": "5.11.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.11.1.tgz", + "integrity": "sha512-gOKhM8JwlFOc2acbOrkYR05NW8M6DCMSvfcJiBB5NDxRE1gv8kbvxKaC9u69e6ZGEMWXcswA/7eKR229cEIpvg==", "dev": true, "requires": { - "ajv": "^6.5.0", - "babel-code-frame": "^6.26.0", + "@babel/code-frame": "^7.0.0", + "ajv": "^6.5.3", "chalk": "^2.1.0", "cross-spawn": "^6.0.5", - "debug": "^3.1.0", + "debug": "^4.0.1", "doctrine": "^2.1.0", "eslint-scope": "^4.0.0", "eslint-utils": "^1.3.1", "eslint-visitor-keys": "^1.0.0", - "espree": "^4.0.0", + "espree": "^5.0.0", "esquery": "^1.0.1", "esutils": "^2.0.2", "file-entry-cache": "^2.0.0", "functional-red-black-tree": "^1.0.1", "glob": "^7.1.2", "globals": "^11.7.0", - "ignore": "^3.3.3", + "ignore": "^4.0.6", "imurmurhash": "^0.1.4", - "inquirer": "^5.2.0", - "is-resolvable": "^1.1.0", - "js-yaml": "^3.11.0", + "inquirer": "^6.1.0", + "js-yaml": "^3.12.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", "lodash": "^4.17.5", @@ -1967,34 +1993,15 @@ "path-is-inside": "^1.0.2", "pluralize": "^7.0.0", "progress": "^2.0.0", - "regexpp": "^1.1.0", + "regexpp": "^2.0.1", "require-uncached": "^1.0.3", - "semver": "^5.5.0", - "string.prototype.matchall": "^2.0.0", + "semver": "^5.5.1", "strip-ansi": "^4.0.0", "strip-json-comments": "^2.0.1", - "table": "^4.0.3", + "table": "^5.0.2", "text-table": "^0.2.0" }, "dependencies": { - "ajv": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.2.tgz", - "integrity": "sha512-hOs7GfvI6tUI1LfZddH82ky6mOMyTuY0mk7kE2pWpmhhUSkumzaTO5vbVwij39MdwPQWCV4Zv57Eo06NtL/GVA==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.1" - } - }, - "ajv-keywords": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", - "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", - "dev": true - }, "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", @@ -2022,18 +2029,18 @@ } }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "esprima": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, "fast-deep-equal": { @@ -2048,6 +2055,12 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -2071,38 +2084,31 @@ "dev": true }, "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", "dev": true }, "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.0.0.tgz", + "integrity": "sha512-4j2WTWjp3GsZ+AOagyzVbzp4vWGtZ0hEZ/gDY/uTvm6MTxUfTUIsnMIFb1bn8o0RuXiqUw15H1bue8f22Vw2oQ==", "dev": true, "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", "is-fullwidth-code-point": "^2.0.0" } }, @@ -2126,26 +2132,38 @@ } }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" } }, "table": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.3.tgz", - "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/table/-/table-5.1.1.tgz", + "integrity": "sha512-NUjapYb/qd4PeFW03HnAuOJ7OMcBkJlqeClWxeNlQ0lXGSb52oZXGzkO0/I0ARegQ2eUT1g2VDJH0eUxDRcHmw==", "dev": true, "requires": { - "ajv": "^6.0.1", - "ajv-keywords": "^3.0.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", - "slice-ansi": "1.0.0", + "ajv": "^6.6.1", + "lodash": "^4.17.11", + "slice-ansi": "2.0.0", "string-width": "^2.1.1" + }, + "dependencies": { + "ajv": { + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.6.2.tgz", + "integrity": "sha512-FBHEW6Jf5TB9MGBgUUA9XHkTbjXYfAUjY43ACMfmdMRHniyoMHjHjzD50OK8LGDWQwp4rWEsIq5kEqq7rvIM1g==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + } } } } @@ -2173,19 +2191,20 @@ "dev": true }, "espree": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-4.0.0.tgz", - "integrity": "sha512-kapdTCt1bjmspxStVKX6huolXVV5ZfyZguY1lcfhVVZstce3bqxH9mcLzNn3/mlgW6wQ732+0fuG9v7h0ZQoKg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.0.tgz", + "integrity": "sha512-1MpUfwsdS9MMoN7ZXqAr9e9UKdVHDcvrJpyx7mm1WuQlx/ygErEQBzgi5Nh5qBHIoYweprhtMkTCb9GhcAIcsA==", "dev": true, "requires": { - "acorn": "^5.6.0", - "acorn-jsx": "^4.1.1" + "acorn": "^6.0.2", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" }, "dependencies": { "acorn": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", - "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.5.tgz", + "integrity": "sha512-i33Zgp3XWtmZBMNvCr4azvOFeWVw1Rk6p3hfi3LUDvIFraOMywb1kAtrbi+med14m4Xfpqm3zRZMT+c0FNE7kg==", "dev": true } } @@ -2228,7 +2247,7 @@ }, "eventemitter2": { "version": "0.4.14", - "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", + "resolved": "http://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", "integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=", "dev": true }, @@ -2574,7 +2593,7 @@ }, "findup-sync": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", + "resolved": "http://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", "dev": true, "requires": { @@ -2623,12 +2642,6 @@ "for-in": "^1.0.1" } }, - "foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", - "dev": true - }, "foreachasync": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/foreachasync/-/foreachasync-3.0.0.tgz", @@ -2667,15 +2680,23 @@ "dev": true }, "fs-extra": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", "requires": { "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "dependencies": { + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "requires": { + "graceful-fs": "^4.1.6" + } + } } }, "fs.realpath": { @@ -2683,12 +2704,6 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", @@ -2779,9 +2794,9 @@ } }, "globals": { - "version": "11.7.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz", - "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==", + "version": "11.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.9.0.tgz", + "integrity": "sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==", "dev": true }, "globby": { @@ -2891,7 +2906,7 @@ }, "grunt-cli": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz", "integrity": "sha1-VisRnrsGndtGSs4oRVAb6Xs1tqg=", "dev": true, "requires": { @@ -2901,28 +2916,29 @@ "resolve": "~1.1.0" } }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "requires": { - "glob": "^7.0.5" + "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } } } @@ -2964,9 +2980,9 @@ "dev": true }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -2985,9 +3001,9 @@ } }, "grunt-known-options": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.0.tgz", - "integrity": "sha1-pCdO6zL6dl2lp6OxcSYXzjsUQUk=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.1.tgz", + "integrity": "sha512-cHwsLqoighpu7TuYj5RonnEuxGVFnztcUqTqp5rXFGYL4OuPFofwC4Ycg7n9fYwvK6F5WbYgeVOwph9Crs2fsQ==", "dev": true }, "grunt-legacy-log": { @@ -3003,9 +3019,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true } } @@ -3047,15 +3063,15 @@ "dev": true }, "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -3079,9 +3095,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true } } @@ -3120,9 +3136,9 @@ } }, "grunt-stylelint": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/grunt-stylelint/-/grunt-stylelint-0.10.0.tgz", - "integrity": "sha512-1HC3H1CZlK3niJGORr+1nmcdtogoSiZex7ej9MtJPXVmxrvWvXTVhZppKoPVVQgHRvNozmtGCZTZr7c9kMPO5g==", + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/grunt-stylelint/-/grunt-stylelint-0.10.1.tgz", + "integrity": "sha512-7MAHUqySn2x0yCS4SEkrv5pVoTrP44j8IZGEF6UTQD9Nm7K96cGEhB6FFMWk+uXbRHiiU+c4s3B0h4rpT8nOyQ==", "dev": true, "requires": { "chalk": "1.1.3" @@ -3199,15 +3215,6 @@ } } }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -3249,12 +3256,6 @@ "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", "dev": true }, - "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", - "dev": true - }, "he": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", @@ -3493,23 +3494,23 @@ "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=" }, "inquirer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", - "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.1.tgz", + "integrity": "sha512-088kl3DRT2dLU5riVMKKr1DlImd6X7smDhpXUCkJDCKvTEJeRiXh0G132HG9u5a+6Ylw9plFRY7RuTnwohYSpg==", "dev": true, "requires": { "ansi-escapes": "^3.0.0", "chalk": "^2.0.0", "cli-cursor": "^2.1.0", "cli-width": "^2.0.0", - "external-editor": "^2.1.0", + "external-editor": "^3.0.0", "figures": "^2.0.0", - "lodash": "^4.3.0", + "lodash": "^4.17.10", "mute-stream": "0.0.7", "run-async": "^2.2.0", - "rxjs": "^5.5.2", + "rxjs": "^6.1.0", "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", + "strip-ansi": "^5.0.0", "through": "^2.3.6" }, "dependencies": { @@ -3539,14 +3540,20 @@ "supports-color": "^5.3.0" } }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, "external-editor": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", "dev": true, "requires": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", "tmp": "^0.0.33" } }, @@ -3556,6 +3563,15 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -3563,9 +3579,9 @@ "dev": true }, "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true }, "string-width": { @@ -3576,34 +3592,44 @@ "requires": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", + "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", + "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", + "dev": true + } } }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" } - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } } } }, @@ -3664,18 +3690,6 @@ "builtin-modules": "^1.0.0" } }, - "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", - "dev": true - }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", - "dev": true - }, "is-decimal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.1.tgz", @@ -3809,27 +3823,12 @@ "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", "dev": true }, - "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", - "dev": true, - "requires": { - "has": "^1.0.1" - } - }, "is-regexp": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", "dev": true }, - "is-resolvable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", - "dev": true - }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", @@ -3842,12 +3841,6 @@ "integrity": "sha1-i1IMhfrnolM4LUsCZS4EVXbhO7g=", "dev": true }, - "is-symbol": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", - "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", - "dev": true - }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -3910,9 +3903,9 @@ "dev": true }, "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, "js-yaml": { @@ -4137,6 +4130,7 @@ "version": "2.4.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, "requires": { "graceful-fs": "^4.1.6" } @@ -4183,14 +4177,6 @@ "is-buffer": "^1.1.5" } }, - "klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", - "requires": { - "graceful-fs": "^4.1.9" - } - }, "lazystream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", @@ -4681,9 +4667,9 @@ } }, "moment": { - "version": "2.22.2", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", - "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=" + "version": "2.23.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.23.0.tgz", + "integrity": "sha512-3IE39bHVqFbWWaPOMHZF98Q9c3LDKGTmypMiTM2QygGXXElkFWIH7GxfmlwmY2vwa+wmNsoYZmG2iusf1ZjJoA==" }, "ms": { "version": "2.0.0", @@ -4708,9 +4694,9 @@ "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" }, "nice-try": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.4.tgz", - "integrity": "sha512-2NpiFHqC87y/zFke0fC0spBXL3bBsoh/p5H1EFhshxjCR5+0g2d6BiXbUFz9v1sAcxsk2htp2eQnNIci2dIYcA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, "nocache": { @@ -5456,9 +5442,9 @@ "dev": true }, "progress": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", - "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, "progress-stream": { @@ -5642,19 +5628,10 @@ "is-equal-shallow": "^0.1.3" } }, - "regexp.prototype.flags": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz", - "integrity": "sha512-ztaw4M1VqgMwl9HlPpOuiYgItcHlunW0He2fE6eNfT6E/CF2FtYi9ofOYe4mKntstYk0Fyh/rDRBdS3AnxjlrA==", - "dev": true, - "requires": { - "define-properties": "^1.1.2" - } - }, "regexpp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", - "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, "remark": { @@ -5836,7 +5813,7 @@ }, "require-uncached": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "resolved": "http://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", "dev": true, "requires": { @@ -5846,7 +5823,7 @@ }, "resolve": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "resolved": "http://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", "dev": true }, @@ -5888,6 +5865,7 @@ "version": "2.6.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", "integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=", + "dev": true, "requires": { "glob": "^7.0.5" } @@ -5922,12 +5900,12 @@ } }, "rxjs": { - "version": "5.5.11", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.11.tgz", - "integrity": "sha512-3bjO7UwWfA2CV7lmwYMBzj4fQ6Cq+ftHc2MvUe+WMS7wcdJ1LosDWmdjPQanYp2dBRj572p7PeU81JUxHKOcBA==", + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", + "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", "dev": true, "requires": { - "symbol-observable": "1.0.1" + "tslib": "^1.9.0" } }, "safe-buffer": { @@ -6237,19 +6215,6 @@ "strip-ansi": "^3.0.0" } }, - "string.prototype.matchall": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-2.0.0.tgz", - "integrity": "sha512-WoZ+B2ypng1dp4iFLF2kmZlwwlE19gmjgKuhL1FJfDgCREWb3ye3SDVHSzLH6bxfnvYmkCxbzkmWcQZHA4P//Q==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.10.0", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "regexp.prototype.flags": "^1.2.0" - } - }, "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", @@ -6680,12 +6645,11 @@ } }, "sumchecker": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-1.3.1.tgz", - "integrity": "sha1-ebs7RFbdBPGOvbwNcDodHa7FEF0=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-2.0.2.tgz", + "integrity": "sha1-D0LBDl0F2l1C7qPlbDOZo31sWz4=", "requires": { - "debug": "^2.2.0", - "es6-promise": "^4.0.5" + "debug": "^2.2.0" } }, "supports-color": { @@ -6721,12 +6685,6 @@ "integrity": "sha1-WPcc7jvVGbWdSyqEO2x95krAR2Q=", "dev": true }, - "symbol-observable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", - "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=", - "dev": true - }, "symbol-tree": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", @@ -6982,6 +6940,12 @@ "integrity": "sha1-qf2LA5Swro//guBjOgo2zK1bX4Y=", "dev": true }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -7037,9 +7001,9 @@ "dev": true }, "underscore.string": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.4.tgz", - "integrity": "sha1-LCo/n4PmR2L9xF5s6sZRQoZCE9s=", + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.5.tgz", + "integrity": "sha512-g+dpmgn+XBneLmXXo+sGlW5xQEt4ErkS3mgeN2GFbremYeMBSJKr9Wf2KJplQVaiPY/f7FN6atosWYNm9ovrYg==", "dev": true, "requires": { "sprintf-js": "^1.0.3", @@ -7133,6 +7097,11 @@ "unist-util-is": "^2.1.1" } }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + }, "unix-crypt-td-js": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unix-crypt-td-js/-/unix-crypt-td-js-1.0.0.tgz", diff --git a/package.json b/package.json index 5a657153..3180f70d 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "ajv": "6.5.5", "body-parser": "^1.18.2", "colors": "^1.1.2", - "electron": "^2.0.16", + "electron": "^3.0.13", "express": "^4.16.2", "express-ipfilter": "0.3.1", "feedme": "latest", From f3847ec6f350a924b123def0882e579e7087e2d6 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Thu, 3 Jan 2019 16:35:30 +0100 Subject: [PATCH 005/116] Bump Node version to 8. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 62cc10a3..d98a72cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: - - "7" + - "8" before_script: - yarn danger ci - npm install grunt-cli -g From 6914465e3dc357b3e15af77f829dedc1ec058bbd Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Thu, 3 Jan 2019 16:42:31 +0100 Subject: [PATCH 006/116] Remove "Focus" to pass test. --- tests/e2e/env_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/env_spec.js b/tests/e2e/env_spec.js index 9454b92e..4bcfc4e8 100644 --- a/tests/e2e/env_spec.js +++ b/tests/e2e/env_spec.js @@ -36,7 +36,7 @@ describe("Electron app environment", function() { it("should open a browserwindow", function() { return app.client .waitUntilWindowLoaded() - .browserWindow.focus() + // .browserWindow.focus() .getWindowCount() .should.eventually.equal(1) .browserWindow.isMinimized() From 2156aac0469418a95dc5507b9ba0c716fd7f3c35 Mon Sep 17 00:00:00 2001 From: fwitte Date: Fri, 4 Jan 2019 12:07:02 +0100 Subject: [PATCH 007/116] fixed typos, fetching forecast parameters by day --- .../weather/providers/openweathermap.js | 50 ++++++++++++++----- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/modules/default/weather/providers/openweathermap.js b/modules/default/weather/providers/openweathermap.js index 89ccfcf5..c156d787 100644 --- a/modules/default/weather/providers/openweathermap.js +++ b/modules/default/weather/providers/openweathermap.js @@ -88,24 +88,48 @@ WeatherProvider.register("openweathermap", { */ generateWeatherObjectsFromForecast(forecasts) { const days = []; + var minTemp = []; + var maxTemp = []; + var rain = 0; + let date = ""; + var weather = new WeatherObject(this.config.units); for (const forecast of forecasts) { - const weather = new WeatherObject(this.config.units); - - weather.date = moment(forecast.dt, "X"); - weather.minTemperature = forecast.temp.min; - weather.maxTemperature = forecast.temp.max; - weather.weatherType = this.convertWeatherType(forecast.weather[0].icon); - if (this.config.units === "imperial" && !isNaN(forecast.rain)) { - weather.rain = forecast.rain / 25.4 + + if (date === moment(forecast.dt, "X").format("YYYY-MM-DD")) { + minTemp.push(forecast.main.temp_min); + maxTemp.push(forecast.main.temp_max); + if (this.config.units === "imperial" && !isNaN(forecast.rain["3h"])) { + rain += forecast.rain["3h"] / 25.4; + } else { + rain += forecast.rain["3h"]; + } } else { - weather.rain = forecast.rain; + weather.minTemperature = Math.min.apply(null, minTemp); + weather.maxTemperature = Math.max.apply(null, maxTemp); + weather.rain = rain; + days.push(weather); + weather = new WeatherObject(this.config.units); + + minTemp = []; + maxTemp = []; + rain *= 0; + date = moment(forecast.dt, "X").format("YYYY-MM-DD"); + + weather.date = moment(forecast.dt, "X"); + weather.weatherType = this.convertWeatherType(forecast.weather[0].icon); + + minTemp.push(forecast.main.temp_min); + maxTemp.push(forecast.main.temp_max); + if (this.config.units === "imperial" && !isNaN(forecast.rain["3h"])) { + rain += forecast.rain["3h"] / 25.4; + } else { + rain += forecast.rain["3h"]; + } } - - days.push(weather); } - - return days; + + return days.slice(1); }, /* From b55685d610019a354763a5215ecc02bd59c0873c Mon Sep 17 00:00:00 2001 From: fwitte Date: Fri, 4 Jan 2019 12:13:39 +0100 Subject: [PATCH 008/116] added comments --- .../default/weather/providers/openweathermap.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/default/weather/providers/openweathermap.js b/modules/default/weather/providers/openweathermap.js index c156d787..64df4104 100644 --- a/modules/default/weather/providers/openweathermap.js +++ b/modules/default/weather/providers/openweathermap.js @@ -87,16 +87,21 @@ WeatherProvider.register("openweathermap", { * Generate WeatherObjects based on forecast information */ generateWeatherObjectsFromForecast(forecasts) { + // initial variable declaration const days = []; + // variables for temperature range and rain var minTemp = []; var maxTemp = []; var rain = 0; + // variable for date let date = ""; var weather = new WeatherObject(this.config.units); for (const forecast of forecasts) { if (date === moment(forecast.dt, "X").format("YYYY-MM-DD")) { + // the same day as before + // add values from forecast to corresponding variables minTemp.push(forecast.main.temp_min); maxTemp.push(forecast.main.temp_max); if (this.config.units === "imperial" && !isNaN(forecast.rain["3h"])) { @@ -105,20 +110,30 @@ WeatherProvider.register("openweathermap", { rain += forecast.rain["3h"]; } } else { + // a new day + // calculate minimum/maximum temperature, specify rain amount weather.minTemperature = Math.min.apply(null, minTemp); weather.maxTemperature = Math.max.apply(null, maxTemp); weather.rain = rain; + // push weather information to days array days.push(weather); + // create new weather-object weather = new WeatherObject(this.config.units); minTemp = []; maxTemp = []; rain *= 0; + + // set new date date = moment(forecast.dt, "X").format("YYYY-MM-DD"); + // specify date weather.date = moment(forecast.dt, "X"); + + // select weather type by first forecast value of a day, is this reasonable? weather.weatherType = this.convertWeatherType(forecast.weather[0].icon); + // add values from first forecast of this day to corresponding variables minTemp.push(forecast.main.temp_min); maxTemp.push(forecast.main.temp_max); if (this.config.units === "imperial" && !isNaN(forecast.rain["3h"])) { From 9e394ea349c23dfaa67984601aeafc2dcfe60234 Mon Sep 17 00:00:00 2001 From: fwitte Date: Fri, 4 Jan 2019 12:34:12 +0100 Subject: [PATCH 009/116] updated CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b990c080..913e95c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Updated ### Fixed +- Weather forecast now works with openweathermap in new weather module. Daily data are displayed, see issue [#1504](https://github.com/MichMich/MagicMirror/issues/1504). ## [2.6.0] - 2019-01-01 From 1df2de92026ddcd68b8f1250b9fa205a8b843fde Mon Sep 17 00:00:00 2001 From: fwitte Date: Fri, 4 Jan 2019 12:34:29 +0100 Subject: [PATCH 010/116] updated README --- modules/default/weather/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/weather/README.md b/modules/default/weather/README.md index 89e65de1..d10297d1 100644 --- a/modules/default/weather/README.md +++ b/modules/default/weather/README.md @@ -78,7 +78,7 @@ The following properties can be configured: | ---------------------------- | ----------- | `apiVersion` | The OpenWeatherMap API version to use.

**Default value:** `2.5` | `apiBase` | The OpenWeatherMap base URL.

**Default value:** `'http://api.openweathermap.org/data/'` -| `weatherEndpoint` | The OpenWeatherMap API endPoint.

**Possible values:** `/weather` or `/forecast/daily`
**Default value:** `'/weather'` +| `weatherEndpoint` | The OpenWeatherMap API endPoint.

**Possible values:** `/weather`, `/forecast` or `/forecast/daily` (paying users only)
**Default value:** `'/weather'` | `locationID` | Location ID from [OpenWeatherMap](https://openweathermap.org/find) **This will override anything you put in location.**
Leave blank if you want to use location.
**Example:** `1234567`
**Default value:** `false`

**Note:** When the `location` and `locationID` are both not set, the location will be based on the information provided by the calendar module. The first upcoming event with location data will be used. | `location` | The location used for weather information.

**Example:** `'Amsterdam,Netherlands'`
**Default value:** `false`

**Note:** When the `location` and `locationID` are both not set, the location will be based on the information provided by the calendar module. The first upcoming event with location data will be used. | `apiKey` | The [OpenWeatherMap](https://home.openweathermap.org) API key, which can be obtained by creating an OpenWeatherMap account.

This value is **REQUIRED** From a257b15f86448785b4124e594a6d565ab2334955 Mon Sep 17 00:00:00 2001 From: shbatm Date: Fri, 4 Jan 2019 09:23:10 -0600 Subject: [PATCH 011/116] Error handling for bad git data in updatenotification Update CHANGELOG --- CHANGELOG.md | 1 + modules/default/updatenotification/node_helper.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d47f3fa7..d5c35403 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503). +- Fixed unhandled error on bad git data in updatenotiifcation module [#1285](https://github.com/MichMich/MagicMirror/issues/1285). ## [2.6.0] - 2019-01-01 diff --git a/modules/default/updatenotification/node_helper.js b/modules/default/updatenotification/node_helper.js index df989faa..9d278751 100644 --- a/modules/default/updatenotification/node_helper.js +++ b/modules/default/updatenotification/node_helper.js @@ -65,8 +65,10 @@ module.exports = NodeHelper.create({ data.module = sg.module; if (!err) { sg.git.log({"-1": null}, function(err, data2) { - data.hash = data2.latest.hash; - self.sendSocketNotification("STATUS", data); + if (!err) { + data.hash = data2.latest.hash; + self.sendSocketNotification("STATUS", data); + } }); } }); From b9d6a235e3591b561b5c340ecf3af0003b842207 Mon Sep 17 00:00:00 2001 From: shbatm Date: Fri, 4 Jan 2019 12:37:58 -0600 Subject: [PATCH 012/116] Fixes Incomplete fix for MichMich/MagicMirror#1507 --- modules/default/updatenotification/node_helper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/updatenotification/node_helper.js b/modules/default/updatenotification/node_helper.js index 9d278751..25c088ba 100644 --- a/modules/default/updatenotification/node_helper.js +++ b/modules/default/updatenotification/node_helper.js @@ -65,7 +65,7 @@ module.exports = NodeHelper.create({ data.module = sg.module; if (!err) { sg.git.log({"-1": null}, function(err, data2) { - if (!err) { + if (!err && data2.latest) { data.hash = data2.latest.hash; self.sendSocketNotification("STATUS", data); } From dc363de61037c7608e3ef37cdb59f472b176d279 Mon Sep 17 00:00:00 2001 From: fewieden Date: Fri, 4 Jan 2019 19:43:07 +0100 Subject: [PATCH 013/116] fix weather forecast table height --- modules/default/weather/weather.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/default/weather/weather.css b/modules/default/weather/weather.css index dfa2b12a..3a061bd4 100644 --- a/modules/default/weather/weather.css +++ b/modules/default/weather/weather.css @@ -36,6 +36,10 @@ padding-right: 0; } +.weather tr .weathericon { + line-height: 25px; +} + .weather tr.colored .min-temp { color: #bcddff; } From 827fbfb78f1d120b84d1fe84661e8fbbf1537634 Mon Sep 17 00:00:00 2001 From: fewieden Date: Fri, 4 Jan 2019 19:43:48 +0100 Subject: [PATCH 014/116] dimmed loading indicator for weather forecast --- modules/default/weather/forecast.njk | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/default/weather/forecast.njk b/modules/default/weather/forecast.njk index 1f247867..556a98ff 100644 --- a/modules/default/weather/forecast.njk +++ b/modules/default/weather/forecast.njk @@ -1,25 +1,27 @@ {% if forecast %} - +
{% for f in forecast %} - - + + {% if config.showRainAmount %} {% endif %} {% endfor %}
{{f.date.format('ddd')}}{{ f.date.format('ddd') }} - {{f.maxTemperature | roundValue | unit("temperature")}} + {{ f.maxTemperature | roundValue | unit("temperature") }} - {{f.minTemperature | roundValue | unit("temperature")}} + {{ f.minTemperature | roundValue | unit("temperature") }} - {{f.rain | unit("rain")}} + {{ f.rain | unit("rain") }}
{% else %} - {{"LOADING" | translate}} +
+ {{ "LOADING" | translate }} +
{% endif %} From 5759ed3728b1329502e0dbfffa109caa5e69473b Mon Sep 17 00:00:00 2001 From: fewieden Date: Fri, 4 Jan 2019 19:46:54 +0100 Subject: [PATCH 015/116] implemented config option decimal symbol, align indoor elements vertical, add humidity support to nunjuck unit filter, do not display degree symbol for kelvin --- modules/default/weather/current.njk | 45 ++++++++++++++++------------- modules/default/weather/weather.js | 11 ++++++- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/modules/default/weather/current.njk b/modules/default/weather/current.njk index aed51ac6..55720e23 100644 --- a/modules/default/weather/current.njk +++ b/modules/default/weather/current.njk @@ -4,31 +4,30 @@ {% if config.useBeaufort %} - {{current.beaufortWindSpeed() | round}} + {{ current.beaufortWindSpeed() | round }} {% else %} - {{current.windSpeed | round}} + {{ current.windSpeed | round }} {% endif %} - {% if config.showWindDirection %} {% if config.showWindDirectionAsArrow %} - + {% else %} - {{current.cardinalWindDirection() | translate}} + {{ current.cardinalWindDirection() | translate }} {% endif %}   {% endif %} {% if config.showHumidity and current.humidity %} - {{ current.humidity }}  + {{ current.humidity | decimalSymbol }}  {% endif %} - + {% if current.nextSunAction() == "sunset" %} - {{current.sunset | formatTime}} + {{ current.sunset | formatTime }} {% else %} - {{current.sunrise | formatTime}} + {{ current.sunrise | formatTime }} {% endif %} @@ -36,31 +35,37 @@
- {{current.temperature | roundValue | unit("temperature")}} + {{ current.temperature | roundValue | unit("temperature") | decimalSymbol }} +
+
{% if config.showIndoorTemperature and indoor.temperature %} - - - {{indoor.temperature | roundValue | unit("temperature")}} - +
+ + + {{ indoor.temperature | roundValue | unit("temperature") | decimalSymbol }} + +
{% endif %} {% if config.showIndoorHumidity and indoor.humidity %} - - - {{indoor.humidity | roundValue}}% - +
+ + + {{ indoor.humidity | roundValue | unit("humidity") | decimalSymbol }} + +
{% endif %}
{% if config.showFeelsLike and not config.onlyTemp %}
- {{ "FEELS" | translate }} {{ current.feelsLike() | roundValue | unit("temperature") }} + {{ "FEELS" | translate }} {{ current.feelsLike() | roundValue | unit("temperature") | decimalSymbol }}
{% endif %} {% else %}
- {{"LOADING" | translate}} + {{ "LOADING" | translate }}
{% endif %} diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js index eff3f90e..52e9cfee 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -30,6 +30,7 @@ Module.register("weather",{ lang: config.language, showHumidity: false, degreeLabel: false, + decimalSymbol: ".", showIndoorTemperature: false, showIndoorHumidity: false, @@ -184,7 +185,9 @@ Module.register("weather",{ this.nunjucksEnvironment().addFilter("unit", function (value, type) { if (type === "temperature") { - value += "°"; + if (this.config.units === "metric" || this.config.units === "imperial") { + value += "°"; + } if (this.config.degreeLabel) { if (this.config.units === "metric") { value += "C"; @@ -200,6 +203,8 @@ Module.register("weather",{ } else { value = `${value.toFixed(2)} ${this.config.units === "imperial" ? "in" : "mm"}`; } + } else if (type === "humidity") { + value += "%" } return value; @@ -208,5 +213,9 @@ Module.register("weather",{ this.nunjucksEnvironment().addFilter("roundValue", function(value) { return this.roundValue(value); }.bind(this)); + + this.nunjucksEnvironment().addFilter("decimalSymbol", function(value) { + return value.replace(/\./g, this.config.decimalSymbol); + }.bind(this)); } }); From 1f62b8f0b6d0d7c68e16c83087fd00bb45a5efa2 Mon Sep 17 00:00:00 2001 From: shbatm Date: Fri, 4 Jan 2019 18:12:12 -0600 Subject: [PATCH 016/116] Update node_helper.js --- modules/default/updatenotification/node_helper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/updatenotification/node_helper.js b/modules/default/updatenotification/node_helper.js index 25c088ba..f4014519 100644 --- a/modules/default/updatenotification/node_helper.js +++ b/modules/default/updatenotification/node_helper.js @@ -65,7 +65,7 @@ module.exports = NodeHelper.create({ data.module = sg.module; if (!err) { sg.git.log({"-1": null}, function(err, data2) { - if (!err && data2.latest) { + if (!err && data2.latest && "hash" in data2.latest) { data.hash = data2.latest.hash; self.sendSocketNotification("STATUS", data); } From 5d22dbd99e6fa008e8e41757f96640de48784f72 Mon Sep 17 00:00:00 2001 From: fewieden Date: Sat, 5 Jan 2019 10:26:13 +0100 Subject: [PATCH 017/116] changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f34cbf9f..07c92069 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,14 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Fixed unhandled error on bad git data in updatenotiifcation module [#1285](https://github.com/MichMich/MagicMirror/issues/1285). - Weather forecast now works with openweathermap in new weather module. Daily data are displayed, see issue [#1504](https://github.com/MichMich/MagicMirror/issues/1504). +### New weather module +- Fixed weather forecast table display. +- Dimmed loading indicator for weather forecast. +- Implemented config option `decimalSymbol`. +- Aligned indoor values in current weather vertical. +- Added humidity support to nunjuck unit filter. +- Do not display degree symbol for temperature in Kelvin. + ## [2.6.0] - 2019-01-01 ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. If you are having issues updating, make sure you are running the latest version of Node. From b79b48baac929bcbf762f07ab6890713ce93caae Mon Sep 17 00:00:00 2001 From: fewieden Date: Sat, 5 Jan 2019 10:32:09 +0100 Subject: [PATCH 018/116] link issues to changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07c92069..1c346ace 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,10 +22,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Weather forecast now works with openweathermap in new weather module. Daily data are displayed, see issue [#1504](https://github.com/MichMich/MagicMirror/issues/1504). ### New weather module -- Fixed weather forecast table display. +- Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). - Dimmed loading indicator for weather forecast. -- Implemented config option `decimalSymbol`. -- Aligned indoor values in current weather vertical. +- Implemented config option `decimalSymbol` [#1499](https://github.com/MichMich/MagicMirror/issues/1499). +- Aligned indoor values in current weather vertical [#1499](https://github.com/MichMich/MagicMirror/issues/1499). - Added humidity support to nunjuck unit filter. - Do not display degree symbol for temperature in Kelvin. From aa6699cf3e611ced83893dc8c52ce8e91e788c1a Mon Sep 17 00:00:00 2001 From: fewieden Date: Sat, 5 Jan 2019 10:33:58 +0100 Subject: [PATCH 019/116] link issues to changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c346ace..75a849a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Implemented config option `decimalSymbol` [#1499](https://github.com/MichMich/MagicMirror/issues/1499). - Aligned indoor values in current weather vertical [#1499](https://github.com/MichMich/MagicMirror/issues/1499). - Added humidity support to nunjuck unit filter. -- Do not display degree symbol for temperature in Kelvin. +- Do not display degree symbol for temperature in Kelvin [#1503](https://github.com/MichMich/MagicMirror/issues/1503). ## [2.6.0] - 2019-01-01 From ba8685a122d824d21b8d242d96b8aa5d9cc7c8cf Mon Sep 17 00:00:00 2001 From: fwitte Date: Sat, 5 Jan 2019 13:13:53 +0100 Subject: [PATCH 020/116] readded degreesign --- modules/default/currentweather/currentweather.js | 13 ++++++++----- modules/default/weatherforecast/weatherforecast.js | 9 ++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 7285bd2e..2a6d24b9 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -198,16 +198,19 @@ Module.register("currentweather",{ large.appendChild(weatherIcon); var degreeLabel = ""; - if (this.config.degreeLabel) { - switch (this.config.units ) { + if (this.config.units === "metric" || this.config.units === "imperial") { + degreeLabel += "°"; + } + if(this.config.degreeLabel) { + switch(this.config.units) { case "metric": - degreeLabel = " °C"; + degreeLabel += "C"; break; case "imperial": - degreeLabel = " °F"; + degreeLabel += "F"; break; case "default": - degreeLabel = " K"; + degreeLabel += "K"; break; } } diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 3afc7f74..67193696 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -143,16 +143,19 @@ Module.register("weatherforecast",{ iconCell.appendChild(icon); var degreeLabel = ""; + if (this.config.units === "metric" || this.config.units === "imperial") { + degreeLabel += "°"; + } if(this.config.scale) { switch(this.config.units) { case "metric": - degreeLabel = " °C"; + degreeLabel += "C"; break; case "imperial": - degreeLabel = " °F"; + degreeLabel += "F"; break; case "default": - degreeLabel = " K"; + degreeLabel = "K"; break; } } From c2ff949f2d6d11e852c813b8d5e784f3d9752406 Mon Sep 17 00:00:00 2001 From: fwitte Date: Sat, 5 Jan 2019 13:14:10 +0100 Subject: [PATCH 021/116] adjusted CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75a849a2..51c62ed8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) ### Fixed -- Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503). +- Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503), [#1511](https://github.com/MichMich/MagicMirror/issues/1511). - Fixed unhandled error on bad git data in updatenotiifcation module [#1285](https://github.com/MichMich/MagicMirror/issues/1285). - Weather forecast now works with openweathermap in new weather module. Daily data are displayed, see issue [#1504](https://github.com/MichMich/MagicMirror/issues/1504). From 77640714cc47295de7ca39fbb57ef5cb13e4c322 Mon Sep 17 00:00:00 2001 From: fwitte Date: Sat, 5 Jan 2019 16:54:45 +0100 Subject: [PATCH 022/116] adjusted openweathermap module to work with /forecast and forecast/daily --- .../weather/providers/openweathermap.js | 71 ++++++++++++++++--- 1 file changed, 62 insertions(+), 9 deletions(-) diff --git a/modules/default/weather/providers/openweathermap.js b/modules/default/weather/providers/openweathermap.js index 64df4104..53eca7df 100644 --- a/modules/default/weather/providers/openweathermap.js +++ b/modules/default/weather/providers/openweathermap.js @@ -56,8 +56,6 @@ WeatherProvider.register("openweathermap", { }) }, - - /** OpenWeatherMap Specific Methods - These are not part of the default provider methods */ /* * Gets the complete url for the request @@ -87,6 +85,21 @@ WeatherProvider.register("openweathermap", { * Generate WeatherObjects based on forecast information */ generateWeatherObjectsFromForecast(forecasts) { + + if (this.config.weatherEndpoint == "/forecast") { + return this.fetchForecastHourly(forecasts); + } else if (this.config.weatherEndpoint == "/forecast/daily") { + return this.fetchForecastDaily(forecasts); + } + // if weatherEndpoint does not match forecast or forecast/daily, what should be returned? + const days = [new WeatherObject(this.config.units)]; + return days; + }, + + /* + * fetch forecast information for 3-hourly forecast (available for free subscription). + */ + fetchForecastHourly(forecasts) { // initial variable declaration const days = []; // variables for temperature range and rain @@ -96,7 +109,7 @@ WeatherProvider.register("openweathermap", { // variable for date let date = ""; var weather = new WeatherObject(this.config.units); - + for (const forecast of forecasts) { if (date === moment(forecast.dt, "X").format("YYYY-MM-DD")) { @@ -104,10 +117,17 @@ WeatherProvider.register("openweathermap", { // add values from forecast to corresponding variables minTemp.push(forecast.main.temp_min); maxTemp.push(forecast.main.temp_max); - if (this.config.units === "imperial" && !isNaN(forecast.rain["3h"])) { - rain += forecast.rain["3h"] / 25.4; + + if (forecast.hasOwnProperty("rain")) { + if (this.config.units === "imperial" && !isNaN(forecast.rain["3h"])) { + rain += forecast.rain["3h"] / 25.4; + } else if (!isNaN(forecast.rain["3h"])){ + rain += forecast.rain["3h"]; + } else { + rain += 0; + } } else { - rain += forecast.rain["3h"]; + rain += 0; } } else { // a new day @@ -122,7 +142,7 @@ WeatherProvider.register("openweathermap", { minTemp = []; maxTemp = []; - rain *= 0; + rain = 0; // set new date date = moment(forecast.dt, "X").format("YYYY-MM-DD"); @@ -138,15 +158,48 @@ WeatherProvider.register("openweathermap", { maxTemp.push(forecast.main.temp_max); if (this.config.units === "imperial" && !isNaN(forecast.rain["3h"])) { rain += forecast.rain["3h"] / 25.4; - } else { + } else if (!isNaN(forecast.rain["3h"])){ rain += forecast.rain["3h"]; } } } - return days.slice(1); }, + + /* + * fetch forecast information for daily forecast (available for paid subscription or old apiKey). + */ + fetchForecastDaily(forecasts) { + // initial variable declaration + const days = []; + for (const forecast of forecasts) { + const weather = new WeatherObject(this.config.units); + + weather.date = moment(forecast.dt, "X"); + weather.minTemperature = forecast.temp.min; + weather.maxTemperature = forecast.temp.max; + weather.weatherType = this.convertWeatherType(forecast.weather[0].icon); + + // forecast.rain not available if amount is zero + if (forecast.hasOwnProperty("rain")) { + if (this.config.units === "imperial" && !isNaN(forecast.rain)) { + weather.rain = forecast.rain / 25.4; + } else if (!isNaN(forecast.rain["3h"])){ + weather.rain = forecast.rain; + } else { + weather.rain = 0; + } + } else { + weather.rain = 0; + } + + days.push(weather); + } + + return days; + }, + /* * Convert the OpenWeatherMap icons to a more usable name. */ From 9cbf33153365001b11c16868e4a91682973c8f13 Mon Sep 17 00:00:00 2001 From: fwitte Date: Sat, 5 Jan 2019 16:56:47 +0100 Subject: [PATCH 023/116] fixed typo in daily data fetcher --- modules/default/weather/providers/openweathermap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/weather/providers/openweathermap.js b/modules/default/weather/providers/openweathermap.js index 53eca7df..f5d931c5 100644 --- a/modules/default/weather/providers/openweathermap.js +++ b/modules/default/weather/providers/openweathermap.js @@ -185,7 +185,7 @@ WeatherProvider.register("openweathermap", { if (forecast.hasOwnProperty("rain")) { if (this.config.units === "imperial" && !isNaN(forecast.rain)) { weather.rain = forecast.rain / 25.4; - } else if (!isNaN(forecast.rain["3h"])){ + } else if (!isNaN(forecast.rain)){ weather.rain = forecast.rain; } else { weather.rain = 0; From bdcc0c5373202056d5df445a9433ca39147913e0 Mon Sep 17 00:00:00 2001 From: fwitte Date: Sat, 5 Jan 2019 17:16:19 +0100 Subject: [PATCH 024/116] another typo fix --- .../weather/providers/openweathermap.js | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/modules/default/weather/providers/openweathermap.js b/modules/default/weather/providers/openweathermap.js index f5d931c5..b39da760 100644 --- a/modules/default/weather/providers/openweathermap.js +++ b/modules/default/weather/providers/openweathermap.js @@ -5,7 +5,7 @@ * * By Michael Teeuw http://michaelteeuw.nl * MIT Licensed. - * + * * This class is the blueprint for a weather provider. */ @@ -64,7 +64,7 @@ WeatherProvider.register("openweathermap", { return this.config.apiBase + this.config.apiVersion + this.config.weatherEndpoint + this.getParams(); }, - /* + /* * Generate a WeatherObject based on currentWeatherInformation */ generateWeatherObjectFromCurrentWeather(currentWeatherData) { @@ -85,7 +85,7 @@ WeatherProvider.register("openweathermap", { * Generate WeatherObjects based on forecast information */ generateWeatherObjectsFromForecast(forecasts) { - + if (this.config.weatherEndpoint == "/forecast") { return this.fetchForecastHourly(forecasts); } else if (this.config.weatherEndpoint == "/forecast/daily") { @@ -95,7 +95,7 @@ WeatherProvider.register("openweathermap", { const days = [new WeatherObject(this.config.units)]; return days; }, - + /* * fetch forecast information for 3-hourly forecast (available for free subscription). */ @@ -109,15 +109,15 @@ WeatherProvider.register("openweathermap", { // variable for date let date = ""; var weather = new WeatherObject(this.config.units); - + for (const forecast of forecasts) { - + if (date === moment(forecast.dt, "X").format("YYYY-MM-DD")) { // the same day as before // add values from forecast to corresponding variables minTemp.push(forecast.main.temp_min); maxTemp.push(forecast.main.temp_max); - + if (forecast.hasOwnProperty("rain")) { if (this.config.units === "imperial" && !isNaN(forecast.rain["3h"])) { rain += forecast.rain["3h"] / 25.4; @@ -139,33 +139,40 @@ WeatherProvider.register("openweathermap", { days.push(weather); // create new weather-object weather = new WeatherObject(this.config.units); - + minTemp = []; maxTemp = []; rain = 0; - + // set new date date = moment(forecast.dt, "X").format("YYYY-MM-DD"); - + // specify date weather.date = moment(forecast.dt, "X"); - + // select weather type by first forecast value of a day, is this reasonable? weather.weatherType = this.convertWeatherType(forecast.weather[0].icon); - + // add values from first forecast of this day to corresponding variables minTemp.push(forecast.main.temp_min); maxTemp.push(forecast.main.temp_max); - if (this.config.units === "imperial" && !isNaN(forecast.rain["3h"])) { - rain += forecast.rain["3h"] / 25.4; - } else if (!isNaN(forecast.rain["3h"])){ - rain += forecast.rain["3h"]; + + if (forecast.hasOwnProperty("rain")) { + if (this.config.units === "imperial" && !isNaN(forecast.rain["3h"])) { + rain += forecast.rain["3h"] / 25.4; + } else if (!isNaN(forecast.rain["3h"])){ + rain += forecast.rain["3h"]; + } else { + rain += 0; + } + } else { + rain += 0; } } } return days.slice(1); }, - + /* * fetch forecast information for daily forecast (available for paid subscription or old apiKey). */ @@ -180,7 +187,7 @@ WeatherProvider.register("openweathermap", { weather.minTemperature = forecast.temp.min; weather.maxTemperature = forecast.temp.max; weather.weatherType = this.convertWeatherType(forecast.weather[0].icon); - + // forecast.rain not available if amount is zero if (forecast.hasOwnProperty("rain")) { if (this.config.units === "imperial" && !isNaN(forecast.rain)) { @@ -199,7 +206,7 @@ WeatherProvider.register("openweathermap", { return days; }, - + /* * Convert the OpenWeatherMap icons to a more usable name. */ From 8431ebf2e81cc0a7a34bacbc8065924c8a2daa31 Mon Sep 17 00:00:00 2001 From: fwitte Date: Sat, 5 Jan 2019 17:16:37 +0100 Subject: [PATCH 025/116] adjusted README --- modules/default/weather/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/default/weather/README.md b/modules/default/weather/README.md index d10297d1..47c5387d 100644 --- a/modules/default/weather/README.md +++ b/modules/default/weather/README.md @@ -78,17 +78,17 @@ The following properties can be configured: | ---------------------------- | ----------- | `apiVersion` | The OpenWeatherMap API version to use.

**Default value:** `2.5` | `apiBase` | The OpenWeatherMap base URL.

**Default value:** `'http://api.openweathermap.org/data/'` -| `weatherEndpoint` | The OpenWeatherMap API endPoint.

**Possible values:** `/weather`, `/forecast` or `/forecast/daily` (paying users only)
**Default value:** `'/weather'` +| `weatherEndpoint` | The OpenWeatherMap API endPoint.

**Possible values:** `/weather`, `/forecast` (free users) or `/forecast/daily` (paying users or old apiKey only)
**Default value:** `'/weather'` | `locationID` | Location ID from [OpenWeatherMap](https://openweathermap.org/find) **This will override anything you put in location.**
Leave blank if you want to use location.
**Example:** `1234567`
**Default value:** `false`

**Note:** When the `location` and `locationID` are both not set, the location will be based on the information provided by the calendar module. The first upcoming event with location data will be used. | `location` | The location used for weather information.

**Example:** `'Amsterdam,Netherlands'`
**Default value:** `false`

**Note:** When the `location` and `locationID` are both not set, the location will be based on the information provided by the calendar module. The first upcoming event with location data will be used. -| `apiKey` | The [OpenWeatherMap](https://home.openweathermap.org) API key, which can be obtained by creating an OpenWeatherMap account.

This value is **REQUIRED** +| `apiKey` | The [OpenWeatherMap](https://home.openweathermap.org) API key, which can be obtained by creating an OpenWeatherMap account.

This value is **REQUIRED** ### Darksky options | Option | Description | ---------------------------- | ----------- | `apiBase` | The DarkSky base URL. The darksky api has disabled [cors](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), therefore a proxy is required.

**Possible value:** `'https://cors-anywhere.herokuapp.com/https://api.darksky.net'`
This value is **REQUIRED** -| `weatherEndpoint` | The DarkSky API endPoint.

**Possible values:** `/forecast`
This value is **REQUIRED** +| `weatherEndpoint` | The DarkSky API endPoint.

**Possible values:** `/forecast`
This value is **REQUIRED** | `apiKey` | The [DarkSky](https://darksky.net/dev/register) API key, which can be obtained by creating an DarkSky account.

This value is **REQUIRED** | `lat` | The geo coordinate latitude.

This value is **REQUIRED** | `lon` | The geo coordinate longitude.

This value is **REQUIRED** From 40a65eec51a8b9acee62afa72260dba28d8591b7 Mon Sep 17 00:00:00 2001 From: fwitte Date: Sat, 5 Jan 2019 17:16:50 +0100 Subject: [PATCH 026/116] adjusted CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75a849a2..1fce3724 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,6 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503). - Fixed unhandled error on bad git data in updatenotiifcation module [#1285](https://github.com/MichMich/MagicMirror/issues/1285). -- Weather forecast now works with openweathermap in new weather module. Daily data are displayed, see issue [#1504](https://github.com/MichMich/MagicMirror/issues/1504). ### New weather module - Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). @@ -28,6 +27,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Aligned indoor values in current weather vertical [#1499](https://github.com/MichMich/MagicMirror/issues/1499). - Added humidity support to nunjuck unit filter. - Do not display degree symbol for temperature in Kelvin [#1503](https://github.com/MichMich/MagicMirror/issues/1503). +- Weather forecast now works with openweathermap for both, `/forecast` and `/forecast/daily`, in new weather module. If you use the `/forecast`-weatherEndpoint, the hourly data are converted to daily data, see issues [#1504](https://github.com/MichMich/MagicMirror/issues/1504), [#1513](https://github.com/MichMich/MagicMirror/issues/1513). ## [2.6.0] - 2019-01-01 From 1bbf2d8ce6cf1fdba91bfdc9d5614bb6ba6ca346 Mon Sep 17 00:00:00 2001 From: andogit7 <44971673+andogit7@users.noreply.github.com> Date: Sat, 5 Jan 2019 17:04:33 +0000 Subject: [PATCH 027/116] Update clock.js --- modules/default/clock/clock.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/default/clock/clock.js b/modules/default/clock/clock.js index 705b4303..23b801d0 100644 --- a/modules/default/clock/clock.js +++ b/modules/default/clock/clock.js @@ -137,7 +137,8 @@ Module.register("clock",{ clockCircle.style.backgroundSize = "100%"; // The following line solves issue: https://github.com/MichMich/MagicMirror/issues/611 - clockCircle.style.border = "1px solid black"; + // clockCircle.style.border = "1px solid black"; + clockCircle.style.border = "rgba(0, 0, 0, 0.1)"; //Updated fix for Issue 611 where non-black backgrounds are used } else if (this.config.analogFace != "none") { clockCircle.style.border = "2px solid white"; From a477140a4bc7d64124927682f81f973ee1c8abe2 Mon Sep 17 00:00:00 2001 From: andogit7 <44971673+andogit7@users.noreply.github.com> Date: Sat, 5 Jan 2019 17:08:55 +0000 Subject: [PATCH 028/116] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75a849a2..2a24345b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503). - Fixed unhandled error on bad git data in updatenotiifcation module [#1285](https://github.com/MichMich/MagicMirror/issues/1285). - Weather forecast now works with openweathermap in new weather module. Daily data are displayed, see issue [#1504](https://github.com/MichMich/MagicMirror/issues/1504). +- Fixed analogue clock border display issuse where non-black backgrounds used (previous fix for issue 611) ### New weather module - Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). From 1d21f39fbca3feeb5b7465acf6b658d4554ab014 Mon Sep 17 00:00:00 2001 From: andogit7 <44971673+andogit7@users.noreply.github.com> Date: Sat, 5 Jan 2019 17:09:15 +0000 Subject: [PATCH 029/116] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a24345b..6c6521d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503). - Fixed unhandled error on bad git data in updatenotiifcation module [#1285](https://github.com/MichMich/MagicMirror/issues/1285). - Weather forecast now works with openweathermap in new weather module. Daily data are displayed, see issue [#1504](https://github.com/MichMich/MagicMirror/issues/1504). -- Fixed analogue clock border display issuse where non-black backgrounds used (previous fix for issue 611) +- Fixed analogue clock border display issue where non-black backgrounds used (previous fix for issue 611) ### New weather module - Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). From 409939360f0608f7330f06828f368d4230bb2f95 Mon Sep 17 00:00:00 2001 From: fwitte Date: Sun, 6 Jan 2019 10:23:15 +0100 Subject: [PATCH 030/116] do not show 0 mm rain value --- modules/default/weather/weather.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js index 52e9cfee..e8898c64 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -198,7 +198,7 @@ Module.register("weather",{ } } } else if (type === "rain") { - if (isNaN(value)) { + if (isNaN(value) || value === 0) { value = ""; } else { value = `${value.toFixed(2)} ${this.config.units === "imperial" ? "in" : "mm"}`; From d6046d2422e6b0a26c5cff77e23d4794b27fc217 Mon Sep 17 00:00:00 2001 From: fwitte Date: Sun, 6 Jan 2019 10:24:16 +0100 Subject: [PATCH 031/116] simplified fetchForecastHourly function --- .../weather/providers/openweathermap.js | 45 +++++++------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/modules/default/weather/providers/openweathermap.js b/modules/default/weather/providers/openweathermap.js index b39da760..3d257cee 100644 --- a/modules/default/weather/providers/openweathermap.js +++ b/modules/default/weather/providers/openweathermap.js @@ -112,24 +112,7 @@ WeatherProvider.register("openweathermap", { for (const forecast of forecasts) { - if (date === moment(forecast.dt, "X").format("YYYY-MM-DD")) { - // the same day as before - // add values from forecast to corresponding variables - minTemp.push(forecast.main.temp_min); - maxTemp.push(forecast.main.temp_max); - - if (forecast.hasOwnProperty("rain")) { - if (this.config.units === "imperial" && !isNaN(forecast.rain["3h"])) { - rain += forecast.rain["3h"] / 25.4; - } else if (!isNaN(forecast.rain["3h"])){ - rain += forecast.rain["3h"]; - } else { - rain += 0; - } - } else { - rain += 0; - } - } else { + if (date !== moment(forecast.dt, "X").format("YYYY-MM-DD")) { // a new day // calculate minimum/maximum temperature, specify rain amount weather.minTemperature = Math.min.apply(null, minTemp); @@ -152,22 +135,24 @@ WeatherProvider.register("openweathermap", { // select weather type by first forecast value of a day, is this reasonable? weather.weatherType = this.convertWeatherType(forecast.weather[0].icon); + + } + + // the same day as before + // add values from forecast to corresponding variables + minTemp.push(forecast.main.temp_min); + maxTemp.push(forecast.main.temp_max); - // add values from first forecast of this day to corresponding variables - minTemp.push(forecast.main.temp_min); - maxTemp.push(forecast.main.temp_max); - - if (forecast.hasOwnProperty("rain")) { - if (this.config.units === "imperial" && !isNaN(forecast.rain["3h"])) { - rain += forecast.rain["3h"] / 25.4; - } else if (!isNaN(forecast.rain["3h"])){ - rain += forecast.rain["3h"]; - } else { - rain += 0; - } + if (forecast.hasOwnProperty("rain")) { + if (this.config.units === "imperial" && !isNaN(forecast.rain["3h"])) { + rain += forecast.rain["3h"] / 25.4; + } else if (!isNaN(forecast.rain["3h"])){ + rain += forecast.rain["3h"]; } else { rain += 0; } + } else { + rain += 0; } } return days.slice(1); From 8b2d544576a69804e05071543550301a622298eb Mon Sep 17 00:00:00 2001 From: fwitte Date: Sun, 6 Jan 2019 12:24:26 +0100 Subject: [PATCH 032/116] added fade and maxnumberofdays options for forecast --- modules/default/weather/forecast.njk | 6 +++++- modules/default/weather/weather.js | 26 +++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/modules/default/weather/forecast.njk b/modules/default/weather/forecast.njk index 556a98ff..d03d3018 100644 --- a/modules/default/weather/forecast.njk +++ b/modules/default/weather/forecast.njk @@ -1,7 +1,10 @@ {% if forecast %} + {% set numSteps = forecast | calcNumSteps %} + {% set currentStep = 0 %} + {% set forecast = forecast.slice(0, numSteps) %} {% for f in forecast %} - + {% endif %} + {% set currentStep = currentStep + 1 %} {% endfor %}
{{ f.date.format('ddd') }} @@ -16,6 +19,7 @@
{% else %} diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js index 52e9cfee..818bc40a 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -33,6 +33,9 @@ Module.register("weather",{ decimalSymbol: ".", showIndoorTemperature: false, showIndoorHumidity: false, + maxNumberOfDays: 3, + fade: true, + fadePoint: 0.25, // Start on 1/4th of the list. initialLoadDelay: 0, // 0 seconds delay retryDelay: 2500, @@ -198,7 +201,7 @@ Module.register("weather",{ } } } else if (type === "rain") { - if (isNaN(value)) { + if (isNaN(value) || value === 0) { value = ""; } else { value = `${value.toFixed(2)} ${this.config.units === "imperial" ? "in" : "mm"}`; @@ -217,5 +220,26 @@ Module.register("weather",{ this.nunjucksEnvironment().addFilter("decimalSymbol", function(value) { return value.replace(/\./g, this.config.decimalSymbol); }.bind(this)); + + this.nunjucksEnvironment().addFilter("calcNumSteps", function(forecast) { + return Math.min(forecast.length, this.config.maxNumberOfDays); + }.bind(this)); + + this.nunjucksEnvironment().addFilter("opacity", function(currentStep, numSteps) { + if (this.config.fade && this.config.fadePoint < 1) { + if (this.config.fadePoint < 0) { + this.config.fadePoint = 0; + } + var startingPoint = numSteps * this.config.fadePoint; + var numFadesteps = numSteps - startingPoint; + if (currentStep >= startingPoint) { + return 1 - (currentStep - startingPoint) / numFadesteps; + } else { + return 1; + } + } else { + return 1; + } + }.bind(this)); } }); From 63aa840b55cb989fe419b0e633ae6b6da00be714 Mon Sep 17 00:00:00 2001 From: fwitte Date: Sun, 6 Jan 2019 12:30:26 +0100 Subject: [PATCH 033/116] replaced tabs with spaces --- modules/default/weather/forecast.njk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/default/weather/forecast.njk b/modules/default/weather/forecast.njk index d03d3018..315ebff8 100644 --- a/modules/default/weather/forecast.njk +++ b/modules/default/weather/forecast.njk @@ -1,8 +1,8 @@ {% if forecast %} - {% set numSteps = forecast | calcNumSteps %} - {% set currentStep = 0 %} + {% set numSteps = forecast | calcNumSteps %} + {% set currentStep = 0 %} - {% set forecast = forecast.slice(0, numSteps) %} + {% set forecast = forecast.slice(0, numSteps) %} {% for f in forecast %} @@ -19,7 +19,7 @@ {% endif %} - {% set currentStep = currentStep + 1 %} + {% set currentStep = currentStep + 1 %} {% endfor %}
{{ f.date.format('ddd') }}
{% else %} From 733dfa1467741f749f7aca63fa6b8aea4f088383 Mon Sep 17 00:00:00 2001 From: fwitte Date: Sun, 6 Jan 2019 12:34:27 +0100 Subject: [PATCH 034/116] adjusted README --- modules/default/weather/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/default/weather/README.md b/modules/default/weather/README.md index d10297d1..a035e85e 100644 --- a/modules/default/weather/README.md +++ b/modules/default/weather/README.md @@ -71,6 +71,9 @@ The following properties can be configured: | `tableClass` | The class for the forecast table.

**Default value:** `'small'` | `colored` | If set to `true`, the min and max temperature are color coded.

**Default value:** `false` | `showRainAmount` | Show the amount of rain in the forecast

**Possible values:** `true` or `false`
**Default value:** `true` +| `fade` | Fade the future events to black. (Gradient)

**Possible values:** `true` or `false`
**Default value:** `true` +| `fadePoint` | Where to start fade?

**Possible values:** `0` (top of the list) - `1` (bottom of list)
**Default value:** `0.25` +| `maxNumberOfDays` | How many days of forecast to return. Specified by config.js

**Possible values:** `1` - `16`
**Default value:** `5` (5 days)
This value is optional. By default the weatherforecast module will return 5 days. ### Openweathermap options From 766f21b5254bb045b94bb0e6687c1f72c05232c2 Mon Sep 17 00:00:00 2001 From: fwitte Date: Sun, 6 Jan 2019 12:34:44 +0100 Subject: [PATCH 035/116] adjusted default values --- modules/default/weather/weather.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js index 818bc40a..0c230424 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -33,7 +33,7 @@ Module.register("weather",{ decimalSymbol: ".", showIndoorTemperature: false, showIndoorHumidity: false, - maxNumberOfDays: 3, + maxNumberOfDays: 5, fade: true, fadePoint: 0.25, // Start on 1/4th of the list. From 2dfb349609244aec9c37ca787e106e0388bfc959 Mon Sep 17 00:00:00 2001 From: fwitte Date: Mon, 7 Jan 2019 08:19:50 +0100 Subject: [PATCH 036/116] fixed missing last day display in forecast/hourly --- modules/default/weather/providers/openweathermap.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/default/weather/providers/openweathermap.js b/modules/default/weather/providers/openweathermap.js index 3d257cee..9ae7cbd4 100644 --- a/modules/default/weather/providers/openweathermap.js +++ b/modules/default/weather/providers/openweathermap.js @@ -113,7 +113,6 @@ WeatherProvider.register("openweathermap", { for (const forecast of forecasts) { if (date !== moment(forecast.dt, "X").format("YYYY-MM-DD")) { - // a new day // calculate minimum/maximum temperature, specify rain amount weather.minTemperature = Math.min.apply(null, minTemp); weather.maxTemperature = Math.max.apply(null, maxTemp); @@ -135,9 +134,9 @@ WeatherProvider.register("openweathermap", { // select weather type by first forecast value of a day, is this reasonable? weather.weatherType = this.convertWeatherType(forecast.weather[0].icon); - + } - + // the same day as before // add values from forecast to corresponding variables minTemp.push(forecast.main.temp_min); @@ -155,6 +154,13 @@ WeatherProvider.register("openweathermap", { rain += 0; } } + // last day + // calculate minimum/maximum temperature, specify rain amount + weather.minTemperature = Math.min.apply(null, minTemp); + weather.maxTemperature = Math.max.apply(null, maxTemp); + weather.rain = rain; + // push weather information to days array + days.push(weather); return days.slice(1); }, From a79e51c76f8dcfc2ac4dddfb1b18554ecb9af6d5 Mon Sep 17 00:00:00 2001 From: fwitte Date: Mon, 7 Jan 2019 08:51:17 +0100 Subject: [PATCH 037/116] updated +CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75a849a2..f4fd8af8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Aligned indoor values in current weather vertical [#1499](https://github.com/MichMich/MagicMirror/issues/1499). - Added humidity support to nunjuck unit filter. - Do not display degree symbol for temperature in Kelvin [#1503](https://github.com/MichMich/MagicMirror/issues/1503). +- Added fade, fadePoint and maxNumberOfDays properties to the forecast mode [#1516](https://github.com/MichMich/MagicMirror/issues/1516) ## [2.6.0] - 2019-01-01 From f680c83d2d6443d1a1500d4e07f6678d40599144 Mon Sep 17 00:00:00 2001 From: Bardo98 <46172278+Bardo98@users.noreply.github.com> Date: Mon, 7 Jan 2019 21:55:18 +0100 Subject: [PATCH 038/116] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75a849a2..4b1d85c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. If you are having issues running Electron, make sure your [Raspbian is up to date](https://www.raspberrypi.org/documentation/raspbian/updating.md). ### Added +- Italian translation for "Feels" ### Updated - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) From 984608e23f816966cd9a1d87150b12eb34aca3ec Mon Sep 17 00:00:00 2001 From: Bardo98 <46172278+Bardo98@users.noreply.github.com> Date: Mon, 7 Jan 2019 22:05:26 +0100 Subject: [PATCH 039/116] Added Italian translation of "FEELS" --- translations/it.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/translations/it.json b/translations/it.json index a5eaf2f2..e1a5b806 100644 --- a/translations/it.json +++ b/translations/it.json @@ -29,5 +29,7 @@ "UPDATE_NOTIFICATION": "E' disponibile un aggiornamento di MagicMirror².", "UPDATE_NOTIFICATION_MODULE": "E' disponibile un aggiornamento del modulo {MODULE_NAME}.", "UPDATE_INFO_SINGLE": "L'installazione è {COMMIT_COUNT} commit indietro rispetto all'attuale branch {BRANCH_NAME}.", - "UPDATE_INFO_MULTIPLE": "L'installazione è {COMMIT_COUNT} commits indietro rispetto all'attuale branch {BRANCH_NAME}." + "UPDATE_INFO_MULTIPLE": "L'installazione è {COMMIT_COUNT} commits indietro rispetto all'attuale branch {BRANCH_NAME}.", + + "FEELS": "Percepiti" } From b01b9758e0503755e97d805d13021be6acf32831 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 9 Jan 2019 21:24:14 +0000 Subject: [PATCH 040/116] remove Font Awesome 4 dependency --- vendor/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/vendor/package.json b/vendor/package.json index d14f8bcb..241374cb 100644 --- a/vendor/package.json +++ b/vendor/package.json @@ -11,7 +11,6 @@ }, "dependencies": { "@fortawesome/fontawesome-free": "^5.3.1", - "font-awesome": "^4.7.0", "moment": "^2.17.1", "moment-timezone": "^0.5.11", "nunjucks": "^3.0.1", From ef82039401b5122889fac0d8762a25440328b1e8 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 9 Jan 2019 21:29:49 +0000 Subject: [PATCH 041/116] Allow multiple css to be included for one vendor --- vendor/css/font-awesome.css | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 vendor/css/font-awesome.css diff --git a/vendor/css/font-awesome.css b/vendor/css/font-awesome.css new file mode 100644 index 00000000..2ba4a708 --- /dev/null +++ b/vendor/css/font-awesome.css @@ -0,0 +1,2 @@ +@import url("../node_modules/@fortawesome/fontawesome-free/css/all.min.css"); +@import url("../node_modules/@fortawesome/fontawesome-free/css/v4-shims.min.css"); \ No newline at end of file From 7c3923ad00b1e47b1992987a131d940ae7330fa6 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 9 Jan 2019 21:32:43 +0000 Subject: [PATCH 042/116] Use Font Awesome 5 (with backwards compatibility) for all modules --- vendor/vendor.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vendor/vendor.js b/vendor/vendor.js index abbf1423..6acf8427 100644 --- a/vendor/vendor.js +++ b/vendor/vendor.js @@ -12,9 +12,7 @@ var vendor = { "moment-timezone.js" : "node_modules/moment-timezone/builds/moment-timezone-with-data.js", "weather-icons.css": "node_modules/weathericons/css/weather-icons.css", "weather-icons-wind.css": "node_modules/weathericons/css/weather-icons-wind.css", - "font-awesome.css": "node_modules/font-awesome/css/font-awesome.min.css", - "font-awesome5.css": "node_modules/@fortawesome/fontawesome-free/css/all.min.css", - "font-awesome5.v4shims.css": "node_modules/@fortawesome/fontawesome-free/css/v4-shims.min.css", + "font-awesome.css": "css/font-awesome.css", "nunjucks.js": "node_modules/nunjucks/browser/nunjucks.min.js" }; From 00922891052041c2c9f02926d77ccd5114698bf0 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 9 Jan 2019 21:38:07 +0000 Subject: [PATCH 043/116] revert font awesome reference --- modules/default/calendar/calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 38b04269..7b813809 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -51,7 +51,7 @@ Module.register("calendar", { // Define required scripts. getStyles: function () { - return ["calendar.css", "font-awesome5.css", "font-awesome5.v4shims.css"]; + return ["calendar.css", "font-awesome.css"]; }, // Define required scripts. From 8546d6730c98471d167c858555458720bf4dae29 Mon Sep 17 00:00:00 2001 From: Ian Date: Thu, 10 Jan 2019 12:44:35 +0000 Subject: [PATCH 044/116] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12d84620..387dcdb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Fixed unhandled error on bad git data in updatenotiifcation module [#1285](https://github.com/MichMich/MagicMirror/issues/1285). - Weather forecast now works with openweathermap in new weather module. Daily data are displayed, see issue [#1504](https://github.com/MichMich/MagicMirror/issues/1504). - Fixed analogue clock border display issue where non-black backgrounds used (previous fix for issue 611) +- Fixed compatibility issues caused when modules request different versions of Font Awesome, see issue [#1522](https://github.com/MichMich/MagicMirror/issues/1522). MagicMirror now uses [Font Awesome 5 with v4 shims included for backwards compatibility](https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#shims). ### New weather module - Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). From 8f24cc8d137b508d10f61d8df8d70c9ad6c9a1ac Mon Sep 17 00:00:00 2001 From: fdahms Date: Sat, 12 Jan 2019 18:06:52 +0100 Subject: [PATCH 045/116] editing CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 387dcdb1..ad4336c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added - Italian translation for "Feels" +- Disabled the screensaver on raspbian with installation script + ### Updated - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) @@ -23,6 +25,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Weather forecast now works with openweathermap in new weather module. Daily data are displayed, see issue [#1504](https://github.com/MichMich/MagicMirror/issues/1504). - Fixed analogue clock border display issue where non-black backgrounds used (previous fix for issue 611) - Fixed compatibility issues caused when modules request different versions of Font Awesome, see issue [#1522](https://github.com/MichMich/MagicMirror/issues/1522). MagicMirror now uses [Font Awesome 5 with v4 shims included for backwards compatibility](https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#shims). +- Installation script problems with raspbian ### New weather module - Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). From f87adebe41df0ea9a7fa600daa28dcd313fbdf27 Mon Sep 17 00:00:00 2001 From: fdahms Date: Sat, 12 Jan 2019 18:11:48 +0100 Subject: [PATCH 046/116] Fixing raspbian installer * fixing issue #1377 * fixing problem with old node installation from fresh raspbian * add feature for disable screen saver --- installers/raspberry.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/installers/raspberry.sh b/installers/raspberry.sh index 4e9c20d8..6e618c99 100644 --- a/installers/raspberry.sh +++ b/installers/raspberry.sh @@ -47,7 +47,7 @@ sudo apt-get --assume-yes install curl wget git build-essential unzip || exit # Check if we need to install or upgrade Node.js. echo -e "\e[96mCheck current Node installation ...\e[0m" NODE_INSTALL=false -if command_exists node; then +if command_exists node && command_exists npm; then echo -e "\e[0mNode currently installed. Checking version number."; NODE_CURRENT=$(node -v) echo -e "\e[0mMinimum Node version: \e[1m$NODE_TESTED\e[0m" @@ -152,9 +152,19 @@ fi read -p "Do you want use pm2 for auto starting of your MagicMirror (y/N)?" choice if [[ $choice =~ ^[Yy]$ ]]; then sudo npm install -g pm2 - sudo su -c "env PATH=$PATH:/usr/bin pm2 startup linux -u pi --hp /home/pi" - pm2 start ~/MagicMirror/installers/pm2_MagicMirror.json - pm2 save + if [[ "$(ps --no-headers -o comm 1)" =~ systemd ]]; then #Checking for systemd + sudo pm2 startup systemd -u pi --hp /home/pi + else + sudo su -c "env PATH=$PATH:/usr/bin pm2 startup linux -u pi --hp /home/pi" + fi + pm2 start ~/MagicMirror/installers/pm2_MagicMirror.json + pm2 save +fi +# Disable Screensaver +read -p "Do you want to disable the screen saver? (y/N)?" choice +if [[ $choice =~ ^[Yy]$ ]]; then + su -c "echo -e '@xset s noblank\n@xset s off\n@xset -dpms' >> /etc/xdg/lxsession/LXDE-pi/autostart" + export DISPLAY=:0; xset s noblank;xset s off;xset -dpms fi echo " " From 90c96f7479444c6f77c52a953ba1aefb8a059d67 Mon Sep 17 00:00:00 2001 From: Yvonne Date: Sun, 13 Jan 2019 09:26:37 +1100 Subject: [PATCH 047/116] Update README.md --- modules/default/weather/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/weather/README.md b/modules/default/weather/README.md index 89e65de1..1bfa3aff 100644 --- a/modules/default/weather/README.md +++ b/modules/default/weather/README.md @@ -2,7 +2,7 @@ This module is aimed to be the replacement for the current `currentweather` and `weatherforcast` modules. The module will be configurable to be used as a current weather view, or to show the forecast. This way the module can be used twice to fullfil both purposes. -The biggest cange is the use of weather providers. This way we are not bound to one API source. And users can choose which API they want to use as their source. +The biggest change is the use of weather providers. This way we are not bound to one API source. And users can choose which API they want to use as their source. The module is in a very early stage, and needs a lot of work. It's API isn't set in stone, so keep that in mind when you want to contribute. From 1c830594829c6544f81230879a8b8f6614c4153d Mon Sep 17 00:00:00 2001 From: Jan Syring-Lingenfelder Date: Sun, 13 Jan 2019 16:07:02 +0100 Subject: [PATCH 048/116] fix: only show repeating count if the event is actually repeating --- modules/default/calendar/calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 7b813809..d9cc8291 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -220,7 +220,7 @@ Module.register("calendar", { var titleWrapper = document.createElement("td"), repeatingCountTitle = ""; - if (this.config.displayRepeatingCountTitle) { + if (this.config.displayRepeatingCountTitle && event.firstYear !== undefined) { repeatingCountTitle = this.countTitleForUrl(event.url); From 06e641015f7853d7cb1dc52c8819befc1f2cc0f1 Mon Sep 17 00:00:00 2001 From: Jan Syring-Lingenfelder Date: Sun, 13 Jan 2019 16:25:57 +0100 Subject: [PATCH 049/116] docs: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad4336c8..0a1c4693 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Fixed analogue clock border display issue where non-black backgrounds used (previous fix for issue 611) - Fixed compatibility issues caused when modules request different versions of Font Awesome, see issue [#1522](https://github.com/MichMich/MagicMirror/issues/1522). MagicMirror now uses [Font Awesome 5 with v4 shims included for backwards compatibility](https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#shims). - Installation script problems with raspbian +- Calendar: only show repeating count if the event is actually repeating [#1534](https://github.com/MichMich/MagicMirror/pull/1534) ### New weather module - Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). From 6d9675a299287a52430fc0bc1e59439f1ff12f09 Mon Sep 17 00:00:00 2001 From: fdahms Date: Sun, 13 Jan 2019 20:07:20 +0100 Subject: [PATCH 050/116] forgot one sudo --- installers/raspberry.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installers/raspberry.sh b/installers/raspberry.sh index 6e618c99..1551b5fb 100644 --- a/installers/raspberry.sh +++ b/installers/raspberry.sh @@ -163,7 +163,7 @@ fi # Disable Screensaver read -p "Do you want to disable the screen saver? (y/N)?" choice if [[ $choice =~ ^[Yy]$ ]]; then - su -c "echo -e '@xset s noblank\n@xset s off\n@xset -dpms' >> /etc/xdg/lxsession/LXDE-pi/autostart" + sudo su -c "echo -e '@xset s noblank\n@xset s off\n@xset -dpms' >> /etc/xdg/lxsession/LXDE-pi/autostart" export DISPLAY=:0; xset s noblank;xset s off;xset -dpms fi From 399e1710836420617d6a00725d251f7bc800d2b2 Mon Sep 17 00:00:00 2001 From: Andrew McOlash Date: Wed, 16 Jan 2019 22:51:44 -0800 Subject: [PATCH 051/116] Add in cutting of long vertical titles --- CHANGELOG.md | 2 +- modules/default/calendar/README.md | 1 + modules/default/calendar/calendar.js | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a1c4693..2dbc2675 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added - Italian translation for "Feels" - Disabled the screensaver on raspbian with installation script - +- Added option to truncate the number of vertical lines a calendar item can span if `wrapEvents` is enabled. ### Updated - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index b272a2d2..e0d727c8 100755 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -32,6 +32,7 @@ The following properties can be configured: | `defaultSymbol` | The default symbol.

**Possible values:** See [Font Awsome](http://fontawesome.io/icons/) website.
**Default value:** `calendar` | `maxTitleLength` | The maximum title length.

**Possible values:** `10` - `50`
**Default value:** `25` | `wrapEvents` | Wrap event titles to multiple lines. Breaks lines at the length defined by `maxTitleLength`.

**Possible values:** `true` or `false`
**Default value:** `false` +| `maxTitleLines` | The maximum number of lines a title will wrap vertically before being cut (Only enabled if `wrapEvents` is also enabled).

**Possible values:** `0` - `10`
**Default value:** `3` | `fetchInterval` | How often does the content needs to be fetched? (Milliseconds)

**Possible values:** `1000` - `86400000`
**Default value:** `300000` (5 minutes) | `animationSpeed` | Speed of the update animation. (Milliseconds)

**Possible values:** `0` - `5000`
**Default value:** `2000` (2 seconds) | `fade` | Fade the future events to black. (Gradient)

**Possible values:** `true` or `false`
**Default value:** `true` diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index d9cc8291..f2017a6c 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -19,6 +19,7 @@ Module.register("calendar", { defaultRepeatingCountTitle: "", maxTitleLength: 25, wrapEvents: false, // wrap events to multiple lines breaking at maxTitleLength + maxTitleLines: 3, fetchInterval: 5 * 60 * 1000, // Update every 5 minutes. animationSpeed: 2000, fade: true, @@ -220,7 +221,7 @@ Module.register("calendar", { var titleWrapper = document.createElement("td"), repeatingCountTitle = ""; - if (this.config.displayRepeatingCountTitle && event.firstYear !== undefined) { + if (this.config.displayRepeatingCountTitle && event.firstYear !== undefined) { repeatingCountTitle = this.countTitleForUrl(event.url); @@ -584,9 +585,10 @@ Module.register("calendar", { * @param {string} string Text string to shorten * @param {number} maxLength The max length of the string * @param {boolean} wrapEvents Wrap the text after the line has reached maxLength + * @param {number} maxTitleLines The max number of vertical lines before cutting event title * @returns {string} The shortened string */ - shorten: function (string, maxLength, wrapEvents) { + shorten: function (string, maxLength, wrapEvents, maxTitleLines) { if (typeof string !== "string") { return ""; } @@ -595,12 +597,19 @@ Module.register("calendar", { var temp = ""; var currentLine = ""; var words = string.split(" "); + var line = 0; for (var i = 0; i < words.length; i++) { var word = words[i]; if (currentLine.length + word.length < (typeof maxLength === "number" ? maxLength : 25) - 1) { // max - 1 to account for a space currentLine += (word + " "); } else { + line++; + if (line > maxTitleLines - 1) { + if (i < words.length) currentLine += "…"; + break; + } + if (currentLine.length > 0) { temp += (currentLine + "
" + word + " "); } else { @@ -651,7 +660,7 @@ Module.register("calendar", { title = title.replace(needle, replacement); } - title = this.shorten(title, this.config.maxTitleLength, this.config.wrapEvents); + title = this.shorten(title, this.config.maxTitleLength, this.config.wrapEvents, this.config.maxTitleLines); return title; }, From 320743ab8d92c2d915b6f879f65003554eec1f27 Mon Sep 17 00:00:00 2001 From: Andrew McOlash Date: Wed, 16 Jan 2019 22:53:28 -0800 Subject: [PATCH 052/116] fix spacing --- modules/default/calendar/calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index f2017a6c..4220ec8c 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -221,7 +221,7 @@ Module.register("calendar", { var titleWrapper = document.createElement("td"), repeatingCountTitle = ""; - if (this.config.displayRepeatingCountTitle && event.firstYear !== undefined) { + if (this.config.displayRepeatingCountTitle && event.firstYear !== undefined) { repeatingCountTitle = this.countTitleForUrl(event.url); From 2e03868021facdad8ca891a5a759cdb84c80ec9d Mon Sep 17 00:00:00 2001 From: vincep5 Date: Thu, 17 Jan 2019 08:54:16 -0600 Subject: [PATCH 053/116] current.njk JS error and Loading string --- CHANGELOG.md | 1 + modules/default/weather/current.njk | 4 ++-- modules/default/weather/forecast.njk | 4 ++-- modules/default/weather/weather.js | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a1c4693..5f2015f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Added humidity support to nunjuck unit filter. - Do not display degree symbol for temperature in Kelvin [#1503](https://github.com/MichMich/MagicMirror/issues/1503). - Added fade, fadePoint and maxNumberOfDays properties to the forecast mode [#1516](https://github.com/MichMich/MagicMirror/issues/1516) +- Fixed Loading string and decimalSymbol string replace [#1538](https://github.com/MichMich/MagicMirror/issues/1538) ## [2.6.0] - 2019-01-01 diff --git a/modules/default/weather/current.njk b/modules/default/weather/current.njk index 55720e23..64d22e7b 100644 --- a/modules/default/weather/current.njk +++ b/modules/default/weather/current.njk @@ -65,9 +65,9 @@ {% endif %} {% else %}
- {{ "LOADING" | translate }} + {{ "LOADING" | translate | safe }}
{% endif %} - + diff --git a/modules/default/weather/forecast.njk b/modules/default/weather/forecast.njk index 315ebff8..56074047 100644 --- a/modules/default/weather/forecast.njk +++ b/modules/default/weather/forecast.njk @@ -24,9 +24,9 @@ {% else %}
- {{ "LOADING" | translate }} + {{ "LOADING" | translate | safe }}
{% endif %} - + diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js index 0c230424..f554c1fe 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -62,7 +62,7 @@ Module.register("weather",{ return ["font-awesome.css", "weather-icons.css", "weather.css"]; }, - // Return the scripts that are nessecery for the weather module. + // Return the scripts that are necessary for the weather module. getScripts: function () { return [ "moment.js", @@ -218,7 +218,7 @@ Module.register("weather",{ }.bind(this)); this.nunjucksEnvironment().addFilter("decimalSymbol", function(value) { - return value.replace(/\./g, this.config.decimalSymbol); + return value.toString().replace(/\./g, this.config.decimalSymbol); }.bind(this)); this.nunjucksEnvironment().addFilter("calcNumSteps", function(forecast) { From a0dde39d97ad4bc3d546d14adfa16da486622e6a Mon Sep 17 00:00:00 2001 From: Andrew McOlash Date: Mon, 21 Jan 2019 00:47:53 -0800 Subject: [PATCH 054/116] Fix braces for if check --- modules/default/calendar/calendar.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 4220ec8c..2c2970ec 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -606,7 +606,9 @@ Module.register("calendar", { } else { line++; if (line > maxTitleLines - 1) { - if (i < words.length) currentLine += "…"; + if (i < words.length) { + currentLine += "…"; + } break; } From 053b01e0362dcf66c2f5a427401dea45848f7f12 Mon Sep 17 00:00:00 2001 From: Mike Date: Fri, 25 Jan 2019 07:50:24 +0000 Subject: [PATCH 055/116] Updated README Scanned through it and corrected some spelling mistakes, nothing that affects the core purpose of the document. --- modules/README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/README.md b/modules/README.md index 8bc8f86e..5fb86df2 100644 --- a/modules/README.md +++ b/modules/README.md @@ -33,8 +33,8 @@ Therefore **we highly recommend you to include the following information in your - A high quality screenshot of your working module - A short, one sentence, clear description what it does (duh!) -- What external API's it depend on, including web links to those -- Wheteher the API/request require a key and the user limitations of those. (Is it free?) +- What external API's it depends upon, including web links to those +- Whether the API/request require a key and the user limitations of those. (Is it free?) Surely this also help you get better recognition and feedback for your work. @@ -46,8 +46,8 @@ A module can be placed in one single folder. Or multiple modules can be grouped ### Files - **modulename/modulename.js** - This is your core module script. -- **modulename/node_helper.js** - This is an optional helper that will be loaded by the node script. The node helper and module script can communicate with each other using an intergrated socket system. -- **modulename/public** - Any files in this folder can be accesed via the browser on `/modulename/filename.ext`. +- **modulename/node_helper.js** - This is an optional helper that will be loaded by the node script. The node helper and module script can communicate with each other using an integrated socket system. +- **modulename/public** - Any files in this folder can be accessed via the browser on `/modulename/filename.ext`. - **modulename/anyfileorfolder** Any other file or folder in the module folder can be used by the core module script. For example: *modulename/css/modulename.css* would be a good path for your additional module styles. ## The Core module file: modulename.js @@ -89,7 +89,7 @@ After the module is initialized, the module instance has a few available module | `this.data` | Object | The data object contain additional metadata about the module instance. (See below) | -The `this.data` data object contain the follwoing metadata: +The `this.data` data object contain the following metadata: - `data.classes` - The classes which are added to the module dom wrapper. - `data.file` - The filename of the core module file. - `data.path` - The path of the module folder. @@ -98,7 +98,7 @@ The `this.data` data object contain the follwoing metadata: #### `defaults: {}` -Any properties defined in the defaults object, will be merged with the module config as defined in the user's config.js file. This is the best place to set your modules's configuration defaults. Any of the module configuration properties can be accessed using `this.config.propertyName`, but more about that later. +Any properties defined in the defaults object, will be merged with the module config as defined in the user's config.js file. This is the best place to set your modules' configuration defaults. Any of the module configuration properties can be accessed using `this.config.propertyName`, but more about that later. #### `requiresVersion:` @@ -134,7 +134,7 @@ loaded: function(callback) { ```` #### `start()` -This method is called when all modules are loaded an the system is ready to boot up. Keep in mind that the dom object for the module is not yet created. The start method is a perfect place to define any additional module properties: +This method is called when all modules are loaded and the system is ready to boot up. Keep in mind that the dom object for the module is not yet created. The start method is a perfect place to define any additional module properties: **Example:** ````javascript @@ -161,7 +161,7 @@ getScripts: function() { } ```` -**Note:** If a file can not be loaded, the boot up of the mirror will stall. Therefore it's advised not to use any external urls. +**Note:** If a file can not be loaded, the boot up of the mirror will stall. Therefore, it's advised not to use any external urls. #### `getStyles()` @@ -174,14 +174,14 @@ The getStyles method is called to request any additional stylesheets that need t getStyles: function() { return [ 'script.css', // will try to load it from the vendor folder, otherwise it will load is from the module folder. - 'font-awesome.css', // this file is available in the vendor folder, so it doesn't need to be avialable in the module folder. + 'font-awesome.css', // this file is available in the vendor folder, so it doesn't need to be available in the module folder. this.file('anotherfile.css'), // this file will be loaded straight from the module folder. 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css', // this file will be loaded from the bootstrapcdn servers. ] } ```` -**Note:** If a file can not be loaded, the boot up of the mirror will stall. Therefore it's advised not to use any external urls. +**Note:** If a file can not be loaded, the boot up of the mirror will stall. Therefore, it's advised not to use any external URLs. #### `getTranslations()` **Should return: Dictionary** @@ -239,7 +239,7 @@ That MagicMirror core has the ability to send notifications to modules. Or even - `notification` - String - The notification identifier. - `payload` - AnyType - The payload of a notification. -- `sender` - Module - The sender of the notification. If this argument is `undefined`, the sender of the notififiction is the core system. +- `sender` - Module - The sender of the notification. If this argument is `undefined`, the sender of the notification is the core system. **Example:** ````javascript @@ -346,7 +346,7 @@ Possible configurable options: - `lockString` - String - When setting lock string, the module can not be shown without passing the correct lockstring. This way (multiple) modules can prevent a module from showing. It's considered best practice to use your modules identifier as the locksString: `this.identifier`. See *visibility locking* below. -**Note 1:** If the hide animation is canceled, for instance because the show method is called before the hide animation was finished, the callback will not be called.
+**Note 1:** If the hide animation is cancelled, for instance because the show method is called before the hide animation was finished, the callback will not be called.
**Note 2:** If the hide animation is hijacked (an other method calls hide on the same module), the callback will not be called.
**Note 3:** If the dom is not yet created, the hide method won't work. Wait for the `DOM_OBJECTS_CREATED` [notification](#notificationreceivednotification-payload-sender). @@ -371,7 +371,7 @@ Possible configurable options: (*Introduced in version: 2.1.0.*) -Visiblity locking helps the module system to prevent unwanted hide/show actions. The following scenario explains the concept: +Visibility locking helps the module system to prevent unwanted hide/show actions. The following scenario explains the concept: **Module B asks module A to hide:** ````javascript @@ -436,7 +436,7 @@ If no translation is found, a fallback will be used. The fallback sequence is as - 4. Translation as defined in core translation file of the fallback language (the first defined core translation file). - 5. The key (identifier) of the translation. -When adding translations to your module, it's a good idea to see if an apropriate translation is already available in the [core translation files](https://github.com/MichMich/MagicMirror/tree/master/translations). This way, your module can benefit from the existing translations. +When adding translations to your module, it's a good idea to see if an appropriate translation is already available in the [core translation files](https://github.com/MichMich/MagicMirror/tree/master/translations). This way, your module can benefit from the existing translations. **Example:** ````javascript @@ -490,7 +490,7 @@ this.translate("RUNNING", { )}); // Will return a translated string for the identifier RUNNING, replacing `{timeUntilEnd}` with the contents of the variable `timeUntilEnd` in the order that translator intended. (has a fallback) ```` -**Example swedish .json file that does not have the variable in it:** +**Example Swedish .json file that does not have the variable in it:** ````javascript { "RUNNING": "Slutar", From 12efb87a23abf641e1836b19eb571aa60ca6f634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Sat, 26 Jan 2019 14:42:15 -0500 Subject: [PATCH 056/116] serveronly: Replace the console.log of none for a \n new line --- serveronly/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/serveronly/index.js b/serveronly/index.js index ccd4c294..3b8013ef 100644 --- a/serveronly/index.js +++ b/serveronly/index.js @@ -1,6 +1,5 @@ var app = require("../js/app.js"); app.start(function(config) { - console.log(""); var bindAddress = config.address ? config.address : "localhost"; - console.log("Ready to go! Please point your browser to: http://" + bindAddress + ":" + config.port); + console.log("\nReady to go! Please point your browser to: http://" + bindAddress + ":" + config.port); }); From 5ca3fbeaea6d5c6c11b2f2e8a5b2959db7f4fcc9 Mon Sep 17 00:00:00 2001 From: Jacob Ebey Date: Sat, 9 Feb 2019 12:42:42 -0800 Subject: [PATCH 057/116] Added autoLocation option for weather modules. --- CHANGELOG.md | 1 + .../default/currentweather/currentweather.js | 14 ++++++++- modules/default/currentweather/node_helper.js | 29 +++++++++++++++++++ .../default/weatherforecast/node_helper.js | 29 +++++++++++++++++++ .../weatherforecast/weatherforecast.js | 15 ++++++++-- 5 files changed, 85 insertions(+), 3 deletions(-) create mode 100644 modules/default/currentweather/node_helper.js create mode 100644 modules/default/weatherforecast/node_helper.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d4787a3..3ff24c38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Italian translation for "Feels" - Disabled the screensaver on raspbian with installation script - Added option to truncate the number of vertical lines a calendar item can span if `wrapEvents` is enabled. +- Added autoLocation options for weather forcast and current weather modules. ### Updated - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 2a6d24b9..0472b7a1 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -11,6 +11,7 @@ Module.register("currentweather",{ // Default module config. defaults: { + autoLocation: false, location: false, locationID: false, appid: "", @@ -109,8 +110,19 @@ Module.register("currentweather",{ this.weatherType = null; this.feelsLike = null; this.loaded = false; - this.scheduleUpdate(this.config.initialLoadDelay); + if (this.config.autoLocation) { + this.sendSocketNotification("AUTO_LOCATION"); + } else { + this.scheduleUpdate(this.config.initialLoadDelay); + } + }, + + socketNotificationReceived: function (notification, payload) { + if (notification === "UPDATE_LOCATION") { + this.config.location = payload.location; + this.scheduleUpdate(this.config.initialLoadDelay); + } }, // add extra information of current weather diff --git a/modules/default/currentweather/node_helper.js b/modules/default/currentweather/node_helper.js new file mode 100644 index 00000000..f650cdb8 --- /dev/null +++ b/modules/default/currentweather/node_helper.js @@ -0,0 +1,29 @@ +var http = require("http"); +var NodeHelper = require("node_helper"); + +module.exports = NodeHelper.create({ + start: function () { + }, + + socketNotificationReceived: function (notification, payload) { + var self = this; + + if (notification === "AUTO_LOCATION") { + console.log("Loading timezone..."); + http.get("http://ip-api.com/json", function (req) { + var data = ""; + req.on("data", function (d) { + data += d; + }); + req.on("end", function () { + var body = JSON.parse(data); + payload.location = body.city + ", " + body.regionName; + self.sendSocketNotification("UPDATE_LOCATION", payload); + }); + }).on("error", function () { + payload.error = "Could not figure out the timezone."; + self.sendSocketNotification("UPDATE_LOCATION", payload); + }); + } + } +}); diff --git a/modules/default/weatherforecast/node_helper.js b/modules/default/weatherforecast/node_helper.js new file mode 100644 index 00000000..f650cdb8 --- /dev/null +++ b/modules/default/weatherforecast/node_helper.js @@ -0,0 +1,29 @@ +var http = require("http"); +var NodeHelper = require("node_helper"); + +module.exports = NodeHelper.create({ + start: function () { + }, + + socketNotificationReceived: function (notification, payload) { + var self = this; + + if (notification === "AUTO_LOCATION") { + console.log("Loading timezone..."); + http.get("http://ip-api.com/json", function (req) { + var data = ""; + req.on("data", function (d) { + data += d; + }); + req.on("end", function () { + var body = JSON.parse(data); + payload.location = body.city + ", " + body.regionName; + self.sendSocketNotification("UPDATE_LOCATION", payload); + }); + }).on("error", function () { + payload.error = "Could not figure out the timezone."; + self.sendSocketNotification("UPDATE_LOCATION", payload); + }); + } + } +}); diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 67193696..1867da36 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -11,6 +11,7 @@ Module.register("weatherforecast",{ // Default module config. defaults: { + autoLocation: false, location: false, locationID: false, appid: "", @@ -95,10 +96,20 @@ Module.register("weatherforecast",{ this.forecast = []; this.loaded = false; - this.scheduleUpdate(this.config.initialLoadDelay); - this.updateTimer = null; + + if (this.config.autoLocation) { + this.sendSocketNotification("AUTO_LOCATION"); + } else { + this.scheduleUpdate(this.config.initialLoadDelay); + } + }, + socketNotificationReceived: function (notification, payload) { + if (notification === "UPDATE_LOCATION") { + this.config.location = payload.location; + this.scheduleUpdate(this.config.initialLoadDelay); + } }, // Override dom generator. From 1a97107b2d1ee5e0d3216ad290d976cf1ec9b568 Mon Sep 17 00:00:00 2001 From: Jacob Ebey Date: Sat, 9 Feb 2019 12:49:47 -0800 Subject: [PATCH 058/116] - Converted indentation to tabs. --- modules/default/currentweather/node_helper.js | 38 +++++++++---------- .../default/weatherforecast/node_helper.js | 38 +++++++++---------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/modules/default/currentweather/node_helper.js b/modules/default/currentweather/node_helper.js index f650cdb8..53956f62 100644 --- a/modules/default/currentweather/node_helper.js +++ b/modules/default/currentweather/node_helper.js @@ -2,28 +2,28 @@ var http = require("http"); var NodeHelper = require("node_helper"); module.exports = NodeHelper.create({ - start: function () { - }, + start: function () { + }, - socketNotificationReceived: function (notification, payload) { - var self = this; + socketNotificationReceived: function (notification, payload) { + var self = this; if (notification === "AUTO_LOCATION") { - console.log("Loading timezone..."); - http.get("http://ip-api.com/json", function (req) { - var data = ""; - req.on("data", function (d) { - data += d; - }); - req.on("end", function () { - var body = JSON.parse(data); - payload.location = body.city + ", " + body.regionName; - self.sendSocketNotification("UPDATE_LOCATION", payload); - }); - }).on("error", function () { - payload.error = "Could not figure out the timezone."; - self.sendSocketNotification("UPDATE_LOCATION", payload); - }); + console.log("Loading timezone..."); + http.get("http://ip-api.com/json", function (req) { + var data = ""; + req.on("data", function (d) { + data += d; + }); + req.on("end", function () { + var body = JSON.parse(data); + payload.location = body.city + ", " + body.regionName; + self.sendSocketNotification("UPDATE_LOCATION", payload); + }); + }).on("error", function () { + payload.error = "Could not figure out the timezone."; + self.sendSocketNotification("UPDATE_LOCATION", payload); + }); } } }); diff --git a/modules/default/weatherforecast/node_helper.js b/modules/default/weatherforecast/node_helper.js index f650cdb8..53956f62 100644 --- a/modules/default/weatherforecast/node_helper.js +++ b/modules/default/weatherforecast/node_helper.js @@ -2,28 +2,28 @@ var http = require("http"); var NodeHelper = require("node_helper"); module.exports = NodeHelper.create({ - start: function () { - }, + start: function () { + }, - socketNotificationReceived: function (notification, payload) { - var self = this; + socketNotificationReceived: function (notification, payload) { + var self = this; if (notification === "AUTO_LOCATION") { - console.log("Loading timezone..."); - http.get("http://ip-api.com/json", function (req) { - var data = ""; - req.on("data", function (d) { - data += d; - }); - req.on("end", function () { - var body = JSON.parse(data); - payload.location = body.city + ", " + body.regionName; - self.sendSocketNotification("UPDATE_LOCATION", payload); - }); - }).on("error", function () { - payload.error = "Could not figure out the timezone."; - self.sendSocketNotification("UPDATE_LOCATION", payload); - }); + console.log("Loading timezone..."); + http.get("http://ip-api.com/json", function (req) { + var data = ""; + req.on("data", function (d) { + data += d; + }); + req.on("end", function () { + var body = JSON.parse(data); + payload.location = body.city + ", " + body.regionName; + self.sendSocketNotification("UPDATE_LOCATION", payload); + }); + }).on("error", function () { + payload.error = "Could not figure out the timezone."; + self.sendSocketNotification("UPDATE_LOCATION", payload); + }); } } }); From c608636b7adbb6e40ea920199825277b99da03c0 Mon Sep 17 00:00:00 2001 From: Jacob Ebey Date: Sat, 9 Feb 2019 13:41:42 -0800 Subject: [PATCH 059/116] - Added autoTimezone property to the clock --- CHANGELOG.md | 1 + modules/default/clock/clock.js | 26 ++++++++++++++++++++----- modules/default/clock/node_helper.js | 29 ++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 modules/default/clock/node_helper.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ff24c38..7d90b047 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Disabled the screensaver on raspbian with installation script - Added option to truncate the number of vertical lines a calendar item can span if `wrapEvents` is enabled. - Added autoLocation options for weather forcast and current weather modules. +- Added autoTimezone option for the default clock module. ### Updated - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) diff --git a/modules/default/clock/clock.js b/modules/default/clock/clock.js index 23b801d0..03528bce 100644 --- a/modules/default/clock/clock.js +++ b/modules/default/clock/clock.js @@ -26,6 +26,7 @@ Module.register("clock",{ analogShowDate: "top", // options: false, 'top', or 'bottom' secondsColor: "#888888", timezone: null, + autoTimezone: false }, // Define required scripts. getScripts: function() { @@ -39,16 +40,31 @@ Module.register("clock",{ start: function() { Log.info("Starting module: " + this.name); - // Schedule update interval. - var self = this; - setInterval(function() { - self.updateDom(); - }, 1000); + if (this.config.autoTimezone) { + this.sendSocketNotification("AUTO_TIMEZONE"); + } else { + // Schedule update interval. + var self = this; + setInterval(function() { + self.updateDom(); + }, 1000); + } // Set locale. moment.locale(config.language); }, + + socketNotificationReceived: function (notification, payload) { + if (notification === "UPDATE_TIMEZONE") { + var self = this; + self.config.timezone = payload.timezone; + setInterval(function() { + self.updateDom(); + }, 1000); + } + }, + // Override dom generator. getDom: function() { diff --git a/modules/default/clock/node_helper.js b/modules/default/clock/node_helper.js new file mode 100644 index 00000000..68258b0a --- /dev/null +++ b/modules/default/clock/node_helper.js @@ -0,0 +1,29 @@ +var http = require("http"); +var NodeHelper = require("node_helper"); + +module.exports = NodeHelper.create({ + start: function () { + }, + + socketNotificationReceived: function (notification, payload) { + var self = this; + + if (notification === "AUTO_TIMEZONE") { + console.log("Loading timezone..."); + http.get("http://ip-api.com/json", function (req) { + var data = ""; + req.on("data", function (d) { + data += d; + }); + req.on("end", function () { + var body = JSON.parse(data); + payload.timezone = body.timezone; + self.sendSocketNotification("UPDATE_TIMEZONE", payload); + }); + }).on("error", function () { + payload.error = "Could not figure out the timezone."; + self.sendSocketNotification("UPDATE_TIMEZONE", payload); + }); + } + } +}); From 3d5ad29eacda9936e10d056a268a67b3c3ac40d3 Mon Sep 17 00:00:00 2001 From: Jacob Ebey Date: Sat, 9 Feb 2019 13:51:23 -0800 Subject: [PATCH 060/116] - Removed trailing space --- modules/default/weatherforecast/weatherforecast.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 1867da36..c32821db 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -97,7 +97,7 @@ Module.register("weatherforecast",{ this.forecast = []; this.loaded = false; this.updateTimer = null; - + if (this.config.autoLocation) { this.sendSocketNotification("AUTO_LOCATION"); } else { From c5888cec661fc40a1a4c22bce206979a5b03e51d Mon Sep 17 00:00:00 2001 From: Anthony Buisset Date: Sun, 10 Feb 2019 16:17:20 +0100 Subject: [PATCH 061/116] Fix exdate handling when multiple values are specified (comma separated) --- CHANGELOG.md | 1 + .../default/calendar/vendor/ical.js/ical.js | 78 ++++++++++++------- 2 files changed, 50 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d4787a3..2085491d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Fixed compatibility issues caused when modules request different versions of Font Awesome, see issue [#1522](https://github.com/MichMich/MagicMirror/issues/1522). MagicMirror now uses [Font Awesome 5 with v4 shims included for backwards compatibility](https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#shims). - Installation script problems with raspbian - Calendar: only show repeating count if the event is actually repeating [#1534](https://github.com/MichMich/MagicMirror/pull/1534) +- Calendar: Fix exdate handling when multiple values are specified (comma separated) ### New weather module - Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). diff --git a/modules/default/calendar/vendor/ical.js/ical.js b/modules/default/calendar/vendor/ical.js/ical.js index f60c5357..8f0c532b 100644 --- a/modules/default/calendar/vendor/ical.js/ical.js +++ b/modules/default/calendar/vendor/ical.js/ical.js @@ -80,16 +80,45 @@ } } - var addTZ = function(dt, name, params){ + var addTZ = function(dt, params){ var p = parseParams(params); - if (params && p){ - dt[name].tz = p.TZID + if (params && p && dt){ + dt.tz = p.TZID } return dt } + var parseTimestamp = function(val){ + //typical RFC date-time format + var comps = /^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(Z)?$/.exec(val); + if (comps !== null) { + if (comps[7] == 'Z'){ // GMT + return new Date(Date.UTC( + parseInt(comps[1], 10), + parseInt(comps[2], 10)-1, + parseInt(comps[3], 10), + parseInt(comps[4], 10), + parseInt(comps[5], 10), + parseInt(comps[6], 10 ) + )); + // TODO add tz + } else { + return new Date( + parseInt(comps[1], 10), + parseInt(comps[2], 10)-1, + parseInt(comps[3], 10), + parseInt(comps[4], 10), + parseInt(comps[5], 10), + parseInt(comps[6], 10) + ); + } + } + + return undefined; + } + var dateParam = function(name){ return function(val, params, curr){ @@ -108,37 +137,24 @@ comps[3] ); - return addTZ(curr, name, params); + curr[name] = addTZ(curr[name], params); + return curr; } } + curr[name] = [] + val.split(',').forEach(function(val){ + var newDate = parseTimestamp(val); + curr[name].push(addTZ(newDate, params)); + }); - //typical RFC date-time format - var comps = /^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(Z)?$/.exec(val); - if (comps !== null) { - if (comps[7] == 'Z'){ // GMT - curr[name] = new Date(Date.UTC( - parseInt(comps[1], 10), - parseInt(comps[2], 10)-1, - parseInt(comps[3], 10), - parseInt(comps[4], 10), - parseInt(comps[5], 10), - parseInt(comps[6], 10 ) - )); - // TODO add tz - } else { - curr[name] = new Date( - parseInt(comps[1], 10), - parseInt(comps[2], 10)-1, - parseInt(comps[3], 10), - parseInt(comps[4], 10), - parseInt(comps[5], 10), - parseInt(comps[6], 10) - ); - } + if (curr[name].length === 0){ + delete curr[name]; + } else if (curr[name].length === 1){ + curr[name] = curr[name][0]; } - return addTZ(curr, name, params) + return curr; } } @@ -148,7 +164,11 @@ if (date.exdates === undefined) { date.exdates = []; } - date.exdates.push(date.exdate); + if (Array.isArray(date.exdate)){ + date.exdates = date.exdates.concat(date.exdate); + } else { + date.exdates.push(date.exdate); + } return date; } } From 017a376616ff240c5f667ecfc9ad421ef403ca4a Mon Sep 17 00:00:00 2001 From: stefsims <17434315+stefsims@users.noreply.github.com> Date: Mon, 11 Feb 2019 08:59:16 +0100 Subject: [PATCH 062/116] Update da.json Added FEELS and WEEK --- translations/da.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/translations/da.json b/translations/da.json index 4f4f50e7..11722d64 100644 --- a/translations/da.json +++ b/translations/da.json @@ -6,6 +6,8 @@ "DAYAFTERTOMORROW": "I overmorgen", "RUNNING": "Slutter om", "EMPTY": "Ingen kommende begivenheder.", + "FEELS": "Føles som", + "WEEK": "Uge {weekNumber}", "N": "N", "NNE": "NNØ", From 56788f093306a8ff37cc26f8984f0f6df00b132d Mon Sep 17 00:00:00 2001 From: stefsims <17434315+stefsims@users.noreply.github.com> Date: Mon, 11 Feb 2019 09:02:42 +0100 Subject: [PATCH 063/116] Update CHANGELOG.md Added danish translation --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d4787a3..9061e7ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Italian translation for "Feels" - Disabled the screensaver on raspbian with installation script - Added option to truncate the number of vertical lines a calendar item can span if `wrapEvents` is enabled. +- Danish translation for "Feels" and "Weeks" ### Updated - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) From 77d14bc218bdd6e5dccc71dc0fd28d6210895776 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Wed, 13 Feb 2019 16:12:46 +0100 Subject: [PATCH 064/116] Add donation link. --- README.md | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3d39832c..2a284ed8 100644 --- a/README.md +++ b/README.md @@ -16,18 +16,22 @@ MagicMirror² focuses on a modular plugin system and uses [Electron](http://elec ## Table Of Contents +- [Table Of Contents](#table-of-contents) - [Installation](#installation) - - [Raspberry Pi](#raspberry-pi) - - [General](#general) - - [Server Only](#server-only) - - [Client Only](#client-only) - - [Docker](#docker) + - [Raspberry Pi](#raspberry-pi) + - [Automatic Installation (Raspberry Pi only!)](#automatic-installation-raspberry-pi-only) + - [Manual Installation](#manual-installation) + - [Server Only](#server-only) + - [Client Only](#client-only) + - [Docker](#docker) - [Configuration](#configuration) + - [Raspberry Specific](#raspberry-specific) + - [General](#general) - [Modules](#modules) - [Updating](#updating) -- [Known Issues](#known-issues) - [Community](#community) - [Contributing Guidelines](#contributing-guidelines) +- [Enjoying MagicMirror? Consider a donation!](#enjoying-magicmirror-consider-a-donation) - [Manifesto](#manifesto) ## Installation @@ -199,6 +203,16 @@ Please keep the following in mind: Thanks for your help in making MagicMirror² better! + +## Enjoying MagicMirror? Consider a donation! + +MagicMirror² is opensource and free. That doesn't mean we don't need any money. + +Please consider a donation to help us cover the ongoing costs like webservers and email services. +If we recieve enough donations we might even be able to free up some working hours and spend some extra time improving the MagicMirror² core. + +To donate, please follow [this](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=G5D8E9MR5DTD2&source=url) link. + ## Manifesto A real Manifesto is still to be written. Till then, Michael's response on [one of the repository issues](https://github.com/MichMich/MagicMirror/issues/1174) gives a great summary: From 3a4902ad4ada92fe560c8e54b86f28b39701ecff Mon Sep 17 00:00:00 2001 From: Jon Kolb Date: Wed, 13 Feb 2019 23:44:10 +0000 Subject: [PATCH 065/116] Fix null dereference in moduleNeedsUpdate when the module isn't visible --- CHANGELOG.md | 1 + js/main.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb8526de..a543e80c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Installation script problems with raspbian - Calendar: only show repeating count if the event is actually repeating [#1534](https://github.com/MichMich/MagicMirror/pull/1534) - Calendar: Fix exdate handling when multiple values are specified (comma separated) +- Fix null dereference in moduleNeedsUpdate when the module isn't visible ### New weather module - Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). diff --git a/js/main.js b/js/main.js index 7ec9b5f3..21a882f8 100644 --- a/js/main.js +++ b/js/main.js @@ -173,6 +173,10 @@ var MM = (function() { */ var moduleNeedsUpdate = function(module, newHeader, newContent) { var moduleWrapper = document.getElementById(module.identifier); + if (moduleWrapper === null) { + return false; + } + var contentWrapper = moduleWrapper.getElementsByClassName("module-content"); var headerWrapper = moduleWrapper.getElementsByClassName("module-header"); From 4a97052708ccd7ee71dea3c8686d0449c16ad440 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Thu, 14 Feb 2019 13:50:16 +0100 Subject: [PATCH 066/116] Fix linting error. --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2a284ed8..e4248411 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,15 @@ MagicMirror² focuses on a modular plugin system and uses [Electron](http://elec - [Table Of Contents](#table-of-contents) - [Installation](#installation) - - [Raspberry Pi](#raspberry-pi) - - [Automatic Installation (Raspberry Pi only!)](#automatic-installation-raspberry-pi-only) - - [Manual Installation](#manual-installation) - - [Server Only](#server-only) - - [Client Only](#client-only) - - [Docker](#docker) + - [Raspberry Pi](#raspberry-pi) + - [Automatic Installation (Raspberry Pi only!)](#automatic-installation-raspberry-pi-only) + - [Manual Installation](#manual-installation) + - [Server Only](#server-only) + - [Client Only](#client-only) + - [Docker](#docker) - [Configuration](#configuration) - - [Raspberry Specific](#raspberry-specific) - - [General](#general) + - [Raspberry Specific](#raspberry-specific) + - [General](#general) - [Modules](#modules) - [Updating](#updating) - [Community](#community) From d6a6a5362338e15b84cc1cddb27b6fa29321083a Mon Sep 17 00:00:00 2001 From: fwitte Date: Thu, 14 Feb 2019 16:48:45 +0100 Subject: [PATCH 067/116] updated weather icon display --- modules/default/weather/providers/openweathermap.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/default/weather/providers/openweathermap.js b/modules/default/weather/providers/openweathermap.js index 9ae7cbd4..856a52c1 100644 --- a/modules/default/weather/providers/openweathermap.js +++ b/modules/default/weather/providers/openweathermap.js @@ -132,10 +132,14 @@ WeatherProvider.register("openweathermap", { // specify date weather.date = moment(forecast.dt, "X"); - // select weather type by first forecast value of a day, is this reasonable? + // If the first value of today is later than 17:00, we have an icon at least! weather.weatherType = this.convertWeatherType(forecast.weather[0].icon); } + + if (moment(forecast.dt, "X").format("H") >= 8 && moment(forecast.dt, "X").format("H") <= 17) { + weather.weatherType = this.convertWeatherType(forecast.weather[0].icon); + } // the same day as before // add values from forecast to corresponding variables From cbe4d2cd7f92ee550abfed8ab1a4d481e49f45a9 Mon Sep 17 00:00:00 2001 From: vincep5 Date: Thu, 14 Feb 2019 13:00:40 -0600 Subject: [PATCH 068/116] weather module adjustments for rain and snow --- CHANGELOG.md | 1 + modules/default/weather/README.md | 2 +- modules/default/weather/forecast.njk | 6 +-- modules/default/weather/providers/README.md | 2 + modules/default/weather/providers/darksky.js | 17 ++++++-- .../weather/providers/openweathermap.js | 42 ++++++++++++++----- modules/default/weather/weather.css | 2 +- modules/default/weather/weather.js | 6 +-- modules/default/weather/weatherobject.js | 2 + 9 files changed, 58 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 061106b5..ab838f7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Weather forecast now works with openweathermap for both, `/forecast` and `/forecast/daily`, in new weather module. If you use the `/forecast`-weatherEndpoint, the hourly data are converted to daily data, see issues [#1504](https://github.com/MichMich/MagicMirror/issues/1504), [#1513](https://github.com/MichMich/MagicMirror/issues/1513). - Added fade, fadePoint and maxNumberOfDays properties to the forecast mode [#1516](https://github.com/MichMich/MagicMirror/issues/1516) - Fixed Loading string and decimalSymbol string replace [#1538](https://github.com/MichMich/MagicMirror/issues/1538) +- Show Snow amounts in new weather module [#1545](https://github.com/MichMich/MagicMirror/issues/1545) ## [2.6.0] - 2019-01-01 diff --git a/modules/default/weather/README.md b/modules/default/weather/README.md index 9de4df7c..d15a208f 100644 --- a/modules/default/weather/README.md +++ b/modules/default/weather/README.md @@ -70,7 +70,7 @@ The following properties can be configured: | ---------------------------- | ----------- | `tableClass` | The class for the forecast table.

**Default value:** `'small'` | `colored` | If set to `true`, the min and max temperature are color coded.

**Default value:** `false` -| `showRainAmount` | Show the amount of rain in the forecast

**Possible values:** `true` or `false`
**Default value:** `true` +| `showPrecipitationAmount` | Show the amount of rain/snow in the forecast

**Possible values:** `true` or `false`
**Default value:** `false` | `fade` | Fade the future events to black. (Gradient)

**Possible values:** `true` or `false`
**Default value:** `true` | `fadePoint` | Where to start fade?

**Possible values:** `0` (top of the list) - `1` (bottom of list)
**Default value:** `0.25` | `maxNumberOfDays` | How many days of forecast to return. Specified by config.js

**Possible values:** `1` - `16`
**Default value:** `5` (5 days)
This value is optional. By default the weatherforecast module will return 5 days. diff --git a/modules/default/weather/forecast.njk b/modules/default/weather/forecast.njk index 56074047..8e997c85 100644 --- a/modules/default/weather/forecast.njk +++ b/modules/default/weather/forecast.njk @@ -13,9 +13,9 @@ {{ f.minTemperature | roundValue | unit("temperature") }} - {% if config.showRainAmount %} - - {{ f.rain | unit("rain") }} + {% if config.showPrecipitationAmount %} + + {{ f.precipitation | unit("precip") }} {% endif %} diff --git a/modules/default/weather/providers/README.md b/modules/default/weather/providers/README.md index f204a88a..85d9c3c5 100644 --- a/modules/default/weather/providers/README.md +++ b/modules/default/weather/providers/README.md @@ -103,6 +103,8 @@ A convinience function to make requests. It returns a promise. | weatherType | `string` | Icon name of the weather type.
Possible values: [WeatherIcons](https://www.npmjs.com/package/weathericons) | | humidity | `number` | Percentage of humidity | | rain | `number` | Metric: `millimeters`
Imperial: `inches` | +| snow | `number` | Metric: `millimeters`
Imperial: `inches` | +| precipitation | `number` | Metric: `millimeters`
Imperial: `inches` | #### Current weather diff --git a/modules/default/weather/providers/darksky.js b/modules/default/weather/providers/darksky.js index 4b1bc4ee..7bfc4c0f 100644 --- a/modules/default/weather/providers/darksky.js +++ b/modules/default/weather/providers/darksky.js @@ -8,6 +8,7 @@ * MIT Licensed * * This class is a provider for Dark Sky. + * Note that the Dark Sky API does not provide rainfall. Instead it provides snowfall and precipitation probability */ WeatherProvider.register("darksky", { // Set the name of the provider. @@ -81,12 +82,20 @@ WeatherProvider.register("darksky", { weather.minTemperature = forecast.temperatureMin; weather.maxTemperature = forecast.temperatureMax; weather.weatherType = this.convertWeatherType(forecast.icon); - if (this.config.units === "metric" && !isNaN(forecast.precipAccumulation)) { - weather.rain = forecast.precipAccumulation * 10; - } else { - weather.rain = forecast.precipAccumulation; + weather.snow = 0; + + // The API will return centimeters if units is 'si' and will return inches for 'us' + // Note that the Dark Sky API does not provide rainfall. Instead it provides snowfall and precipitation probability + if (forecast.hasOwnProperty("precipAccumulation")) { + if (this.config.units === "imperial" && !isNaN(forecast.precipAccumulation)) { + weather.snow = forecast.precipAccumulation; + } else if (!isNaN(forecast.precipAccumulation)) { + weather.snow = forecast.precipAccumulation * 10; + } } + weather.precipitation = weather.snow; + days.push(weather); } diff --git a/modules/default/weather/providers/openweathermap.js b/modules/default/weather/providers/openweathermap.js index 856a52c1..e388e278 100644 --- a/modules/default/weather/providers/openweathermap.js +++ b/modules/default/weather/providers/openweathermap.js @@ -106,6 +106,7 @@ WeatherProvider.register("openweathermap", { var minTemp = []; var maxTemp = []; var rain = 0; + var snow = 0; // variable for date let date = ""; var weather = new WeatherObject(this.config.units); @@ -117,6 +118,8 @@ WeatherProvider.register("openweathermap", { weather.minTemperature = Math.min.apply(null, minTemp); weather.maxTemperature = Math.max.apply(null, maxTemp); weather.rain = rain; + weather.snow = snow; + weather.precipitation = weather.rain + weather.snow; // push weather information to days array days.push(weather); // create new weather-object @@ -125,6 +128,7 @@ WeatherProvider.register("openweathermap", { minTemp = []; maxTemp = []; rain = 0; + snow = 0; // set new date date = moment(forecast.dt, "X").format("YYYY-MM-DD"); @@ -149,20 +153,27 @@ WeatherProvider.register("openweathermap", { if (forecast.hasOwnProperty("rain")) { if (this.config.units === "imperial" && !isNaN(forecast.rain["3h"])) { rain += forecast.rain["3h"] / 25.4; - } else if (!isNaN(forecast.rain["3h"])){ + } else if (!isNaN(forecast.rain["3h"])) { rain += forecast.rain["3h"]; - } else { - rain += 0; } - } else { - rain += 0; + } + + if (forecast.hasOwnProperty("snow")) { + if (this.config.units === "imperial" && !isNaN(forecast.snow["3h"])) { + snow += forecast.snow["3h"] / 25.4; + } else if (!isNaN(forecast.snow["3h"])) { + snow += forecast.snow["3h"]; + } } } + // last day // calculate minimum/maximum temperature, specify rain amount weather.minTemperature = Math.min.apply(null, minTemp); weather.maxTemperature = Math.max.apply(null, maxTemp); weather.rain = rain; + weather.snow = snow; + weather.precipitation = weather.rain + weather.snow; // push weather information to days array days.push(weather); return days.slice(1); @@ -182,20 +193,31 @@ WeatherProvider.register("openweathermap", { weather.minTemperature = forecast.temp.min; weather.maxTemperature = forecast.temp.max; weather.weatherType = this.convertWeatherType(forecast.weather[0].icon); + weather.rain = 0; + weather.snow = 0; // forecast.rain not available if amount is zero + // The API always returns in millimeters if (forecast.hasOwnProperty("rain")) { if (this.config.units === "imperial" && !isNaN(forecast.rain)) { weather.rain = forecast.rain / 25.4; - } else if (!isNaN(forecast.rain)){ + } else if (!isNaN(forecast.rain)) { weather.rain = forecast.rain; - } else { - weather.rain = 0; } - } else { - weather.rain = 0; } + // forecast.snow not available if amount is zero + // The API always returns in millimeters + if (forecast.hasOwnProperty("snow")) { + if (this.config.units === "imperial" && !isNaN(forecast.snow)) { + weather.snow = forecast.snow / 25.4; + } else if (!isNaN(forecast.snow)) { + weather.snow = forecast.snow; + } + } + + weather.precipitation = weather.rain + weather.snow; + days.push(weather); } diff --git a/modules/default/weather/weather.css b/modules/default/weather/weather.css index 3a061bd4..639ce7a9 100644 --- a/modules/default/weather/weather.css +++ b/modules/default/weather/weather.css @@ -31,7 +31,7 @@ padding-right: 0; } -.weather .rain { +.weather .precipitation { padding-left: 20px; padding-right: 0; } diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js index f554c1fe..097b1437 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -49,7 +49,7 @@ Module.register("weather",{ tableClass: "small", onlyTemp: false, - showRainAmount: true, + showPrecipitationAmount: false, colored: false, showFeelsLike: true }, @@ -200,8 +200,8 @@ Module.register("weather",{ value += "K"; } } - } else if (type === "rain") { - if (isNaN(value) || value === 0) { + } else if (type === "precip") { + if (isNaN(value) || value === 0 || value.toFixed(2) === "0.00") { value = ""; } else { value = `${value.toFixed(2)} ${this.config.units === "imperial" ? "in" : "mm"}`; diff --git a/modules/default/weather/weatherobject.js b/modules/default/weather/weatherobject.js index 8768d49d..f3b34bf2 100644 --- a/modules/default/weather/weatherobject.js +++ b/modules/default/weather/weatherobject.js @@ -26,6 +26,8 @@ class WeatherObject { this.weatherType = null; this.humidity = null; this.rain = null; + this.snow = null; + this.precipitation = null; } cardinalWindDirection() { From 954253c7e2059386ad3d60fa33457881ec0e6262 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Fri, 15 Feb 2019 11:15:06 +0100 Subject: [PATCH 069/116] Remove Slack. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index e4248411..1cadc57a 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ License Travis Known Vulnerabilities - Slack Status

**MagicMirror²** is an open source modular smart mirror platform. With a growing list of installable modules, the **MagicMirror²** allows you to convert your hallway or bathroom mirror into your personal assistant. **MagicMirror²** is built by the creator of [the original MagicMirror](http://michaelteeuw.nl/tagged/magicmirror) with the incredible help of a [growing community of contributors](https://github.com/MichMich/MagicMirror/graphs/contributors). From 9686a9ba775aab94b53fdf91242d16426acb0686 Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Mon, 18 Feb 2019 07:18:07 -0600 Subject: [PATCH 070/116] fix relative date fulldate events to use start of dat to start of day difference --- CHANGELOG.md | 1 + modules/default/calendar/calendar.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d97166d..5e591e59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Installation script problems with raspbian - Calendar: only show repeating count if the event is actually repeating [#1534](https://github.com/MichMich/MagicMirror/pull/1534) - Calendar: Fix exdate handling when multiple values are specified (comma separated) +- Calendar: Fix relative date handling for fulldate events, calculate difference always from start of day [#1572] (https://github.com/MichMich/MagicMirror/issues/1572) - Fix null dereference in moduleNeedsUpdate when the module isn't visible ### New weather module diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 2c2970ec..96ab322c 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -302,7 +302,7 @@ Module.register("calendar", { timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").format(this.config.fullDayEventDateFormat)); } } else { - timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow()); + timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").from(moment().format("YYYYMMDD"))); } } if(this.config.showEnd){ From a06ca55107fbe6399ede038afe268138eaf3571f Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Mon, 18 Feb 2019 07:30:46 -0600 Subject: [PATCH 071/116] fix relative date fulldate events to use start of dat to start of day difference, fix extra space in changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e591e59..153031cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Installation script problems with raspbian - Calendar: only show repeating count if the event is actually repeating [#1534](https://github.com/MichMich/MagicMirror/pull/1534) - Calendar: Fix exdate handling when multiple values are specified (comma separated) -- Calendar: Fix relative date handling for fulldate events, calculate difference always from start of day [#1572] (https://github.com/MichMich/MagicMirror/issues/1572) +- Calendar: Fix relative date handling for fulldate events, calculate difference always from start of day [#1572](https://github.com/MichMich/MagicMirror/issues/1572) - Fix null dereference in moduleNeedsUpdate when the module isn't visible ### New weather module From 2d8acec6f006b038c005364f1f9f667ebd8411a6 Mon Sep 17 00:00:00 2001 From: Dirk Date: Mon, 18 Feb 2019 21:04:56 +0100 Subject: [PATCH 072/116] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d97166d..0ef559ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Added autoLocation options for weather forcast and current weather modules. - Added autoTimezone option for the default clock module. - Danish translation for "Feels" and "Weeks" +- Added option to split multiple day events in calendar to separate numbered events ### Updated - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) From d9fcc46994bda99bb6705b329d7960f8d4a6e01b Mon Sep 17 00:00:00 2001 From: Dirk Date: Mon, 18 Feb 2019 21:11:24 +0100 Subject: [PATCH 073/116] included split function to split multiday events --- modules/default/calendar/README.md | 2 ++ modules/default/calendar/calendar.js | 29 ++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index b272a2d2..e3938bda 100755 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -52,6 +52,8 @@ The following properties can be configured: | `hidePrivate` | Hides private calendar events.

**Possible values:** `true` or `false`
**Default value:** `false` | `hideOngoing` | Hides calendar events that have already started.

**Possible values:** `true` or `false`
**Default value:** `false` | `excludedEvents` | An array of words / phrases from event titles that will be excluded from being shown.

Additionally advanced filter objects can be passed in. Below is the configuration for the advance filtering object.
**Required**
`filterBy` - string used to determine if filter is applied.
**Optional**
`until` - Time before an event to display it Ex: [`'3 days'`, `'2 months'`, `'1 week'`]
`caseSensitive` - By default, excludedEvents are case insensitive, set this to true to enforce case sensitivity
`regex` - set to `true` if filterBy is a regex. For those not familiar with regex it is used for pattern matching, please see [here](https://regexr.com/) for more info.

**Example:** `['Birthday', 'Hide This Event', {filterBy: 'Payment', until: '6 days', caseSensitive: true}, {filterBy: '^[0-9]{1,}.*', regex: true}]`
**Default value:** `[]` +| `sliceMultiDayEvents` | If this is set to true, events exceeding at least one midnight will be sliced into separate events including a counter like (1/2). This is especially helpful in "dateheaders" mode. Events will be sliced at midnight, end time for all events but the last will be 23:59 **Default value:** `true` + ### Calendar configuration diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 38b04269..2023b79a 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -46,7 +46,8 @@ Module.register("calendar", { "'s birthday": "" }, broadcastEvents: true, - excludedEvents: [] + excludedEvents: [], + sliceMultiDayEvents: false }, // Define required scripts. @@ -447,7 +448,31 @@ Module.register("calendar", { } event.url = c; event.today = event.startDate >= today && event.startDate < (today + 24 * 60 * 60 * 1000); - events.push(event); + + /* if sliceMultiDayEvents is set to true, multiday events (events exceeding at least one midnight) are sliced into days, + * otherwise, esp. in dateheaders mode it is not clear how long these events are. + */ + if (this.config.sliceMultiDayEvents) { + var midnight = moment(event.startDate, "x").clone().startOf("day").add(1, "day").format("x"); //next midnight + var count = 1; + var maxCount = Math.ceil(((event.endDate - 1) - moment(event.startDate, "x").endOf('day').format("x"))/(1000*60*60*24)) + 1 + if (event.endDate > midnight) { + while (event.endDate > midnight) { + var nextEvent = JSON.parse(JSON.stringify(event)); //make a copy without reference to the original event + nextEvent.startDate = midnight; + event.endDate = midnight; + event.title += " ("+count+"/"+maxCount+")"; + events.push(event); + event = nextEvent; + count += 1; + midnight = moment(midnight, "x").add(1, "day").format("x"); //move further one day for next split + } + event.title += " ("+count+"/"+maxCount+")"; + } + events.push(event); + } else { + events.push(event); + } } } From 2b2e8508d9aebf450c7a81cd7db4b185521b4bc3 Mon Sep 17 00:00:00 2001 From: Dirk Date: Mon, 18 Feb 2019 22:38:28 +0100 Subject: [PATCH 074/116] Update calendar.js Small updates for travis cr check --- modules/default/calendar/calendar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 3fef3846..3a8d05bc 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -456,13 +456,13 @@ Module.register("calendar", { if (this.config.sliceMultiDayEvents) { var midnight = moment(event.startDate, "x").clone().startOf("day").add(1, "day").format("x"); //next midnight var count = 1; - var maxCount = Math.ceil(((event.endDate - 1) - moment(event.startDate, "x").endOf('day').format("x"))/(1000*60*60*24)) + 1 + var maxCount = Math.ceil(((event.endDate - 1) - moment(event.startDate, "x").endOf("day").format("x"))/(1000*60*60*24)) + 1 if (event.endDate > midnight) { while (event.endDate > midnight) { var nextEvent = JSON.parse(JSON.stringify(event)); //make a copy without reference to the original event nextEvent.startDate = midnight; event.endDate = midnight; - event.title += " ("+count+"/"+maxCount+")"; + event.title += " (" + count + "/" + maxCount + ")"; events.push(event); event = nextEvent; count += 1; From 24238094e551dc512698ae306e9e12234fc990ac Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Tue, 19 Feb 2019 13:43:23 +0100 Subject: [PATCH 075/116] Fix url. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e591e59..153031cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Installation script problems with raspbian - Calendar: only show repeating count if the event is actually repeating [#1534](https://github.com/MichMich/MagicMirror/pull/1534) - Calendar: Fix exdate handling when multiple values are specified (comma separated) -- Calendar: Fix relative date handling for fulldate events, calculate difference always from start of day [#1572] (https://github.com/MichMich/MagicMirror/issues/1572) +- Calendar: Fix relative date handling for fulldate events, calculate difference always from start of day [#1572](https://github.com/MichMich/MagicMirror/issues/1572) - Fix null dereference in moduleNeedsUpdate when the module isn't visible ### New weather module From 7630c25ef3448a4327b4fa40d24d51916b2d1d40 Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Tue, 19 Feb 2019 07:06:22 -0600 Subject: [PATCH 076/116] add future date offset correction for emergency date values in absolute mode --- modules/default/calendar/calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 96ab322c..3f4f3f52 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -297,7 +297,7 @@ Module.register("calendar", { if (this.config.timeFormat === "absolute") { if ((this.config.urgency > 1) && (event.startDate - now < (this.config.urgency * oneDay))) { // This event falls within the config.urgency period that the user has set - timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow()); + timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").from(moment().format("YYYYMMDD"))); } else { timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").format(this.config.fullDayEventDateFormat)); } From feb5351ec3036e016aec56b31dac8cf80fd5d194 Mon Sep 17 00:00:00 2001 From: Dirk Date: Tue, 19 Feb 2019 14:07:01 +0100 Subject: [PATCH 077/116] changed default calendarEndDate to "LT" changed default calendarEndDate to "LT" to show local times for event end times. Can still be set to a different value by the user --- modules/default/calendar/calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 3a8d05bc..15ebd1bf 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -26,7 +26,7 @@ Module.register("calendar", { urgency: 7, timeFormat: "relative", dateFormat: "MMM Do", - dateEndFormat: "HH:mm", + dateEndFormat: "LT", fullDayEventDateFormat: "MMM Do", showEnd: false, getRelative: 6, From 4443f57f8ac694bb20e17fb0c2d80f69e1b9ad6e Mon Sep 17 00:00:00 2001 From: Dirk Date: Tue, 19 Feb 2019 14:10:17 +0100 Subject: [PATCH 078/116] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ef559ec..fcafa800 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Calendar: only show repeating count if the event is actually repeating [#1534](https://github.com/MichMich/MagicMirror/pull/1534) - Calendar: Fix exdate handling when multiple values are specified (comma separated) - Fix null dereference in moduleNeedsUpdate when the module isn't visible +- Calendar: Fixed event end times by setting default calendarEndTime to "LT" (Local time format). [#1479] ### New weather module - Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). From f8c4afc228fdb4d753c1612354914f4b1df7c310 Mon Sep 17 00:00:00 2001 From: Michal Dobsovic Date: Wed, 20 Feb 2019 22:02:42 +0100 Subject: [PATCH 079/116] Slovak translation added --- translations/sk.json | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 translations/sk.json diff --git a/translations/sk.json b/translations/sk.json new file mode 100644 index 00000000..8eaeba6d --- /dev/null +++ b/translations/sk.json @@ -0,0 +1,33 @@ +{ + "LOADING": "Načítanie …", + + "TODAY": "Dnes", + "TOMORROW": "Zajtra", + "DAYAFTERTOMORROW": "Pozajtra", + "RUNNING": "Končí o", + "EMPTY": "Žiadne nadchádzajúce udalosti.", + + "WEEK": "{weekNumber}. týždeň", + + "N": "S", + "NNE": "SSV", + "NE": "SV", + "ENE": "VSV", + "E": "V", + "ESE": "VJV", + "SE": "JV", + "SSE": "JJV", + "S": "J", + "SSW": "JJZ", + "SW": "JZ", + "WSW": "ZJZ", + "W": "Z", + "WNW": "ZSZ", + "NW": "SZ", + "NNW": "SSZ", + + "UPDATE_NOTIFICATION": "Dostupná aktualizácia pre MagicMirror².", + "UPDATE_NOTIFICATION_MODULE": "Dostupná aktualizácia pre modul {MODULE_NAME}.", + "UPDATE_INFO_SINGLE": "Súčasná inštalácia je na vetve {BRANCH_NAME} pozadu o {COMMIT_COUNT} commit.", + "UPDATE_INFO_MULTIPLE": "Súčasná inštalácia je na vetve {BRANCH_NAME} pozadu o {COMMIT_COUNT} commitov." +} From 78fbc7f3921385a80466976dbb4ae1ad8fde3822 Mon Sep 17 00:00:00 2001 From: Michal Dobsovic Date: Wed, 20 Feb 2019 22:15:24 +0100 Subject: [PATCH 080/116] Modified CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 304b368e..3ee49dcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Added autoTimezone option for the default clock module. - Danish translation for "Feels" and "Weeks" - Added option to split multiple day events in calendar to separate numbered events +- Slovakian translation ### Updated - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) From 758ffb75a9f234771dc1eb72fd7088946aaa4aa4 Mon Sep 17 00:00:00 2001 From: Michal Dobsovic Date: Sat, 23 Feb 2019 10:37:24 +0100 Subject: [PATCH 081/116] Added sk to translations.js --- translations/translations.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/translations/translations.js b/translations/translations.js index 6625acde..39bf8d5b 100644 --- a/translations/translations.js +++ b/translations/translations.js @@ -38,7 +38,8 @@ var translations = { "cy" : "translations/cy.json", // Welsh (Cymraeg) "bg" : "translations/bg.json", // Bulgarian "cs" : "translations/cs.json", // Czech - "hr" : "translations/hr.json" // Croatian + "hr" : "translations/hr.json", // Croatian + "sk" : "translations/sk.json" // Slovak }; if (typeof module !== "undefined") {module.exports = translations;} From 02ae0df2cc0633541d74da574c517d5f4c9986fe Mon Sep 17 00:00:00 2001 From: Tom Hirschberger Date: Sun, 24 Feb 2019 11:48:14 +0100 Subject: [PATCH 082/116] add font-awesome.css to styles of alert.js --- modules/default/alert/alert.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/alert/alert.js b/modules/default/alert/alert.js index cc0ae302..9c0d91a7 100644 --- a/modules/default/alert/alert.js +++ b/modules/default/alert/alert.js @@ -24,7 +24,7 @@ Module.register("alert",{ return ["classie.js", "modernizr.custom.js", "notificationFx.js"]; }, getStyles: function() { - return ["ns-default.css"]; + return ["ns-default.css", "font-awesome.css"]; }, // Define required translations. getTranslations: function() { From 7b8de354053e7b7bd265f6b6206e746d62333653 Mon Sep 17 00:00:00 2001 From: Thomas Hirschberger <47733292+Tom-Hirschberger@users.noreply.github.com> Date: Sun, 24 Feb 2019 11:55:46 +0100 Subject: [PATCH 083/116] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ee49dcf..38aa9f25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Danish translation for "Feels" and "Weeks" - Added option to split multiple day events in calendar to separate numbered events - Slovakian translation +- Alerts now can contain Font Awesome icons ### Updated - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) From d3b8dbeea079942905cde1bd71124c94c9d598aa Mon Sep 17 00:00:00 2001 From: hudashot <17239583+hudashot@users.noreply.github.com> Date: Mon, 25 Feb 2019 22:47:30 +0000 Subject: [PATCH 084/116] Regularly trigger ADD_CALENDAR to ensure calendar fetcher is running --- CHANGELOG.md | 1 + modules/default/calendar/calendar.js | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38aa9f25..6e7ae65d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Calendar: Fix relative date handling for fulldate events, calculate difference always from start of day [#1572](https://github.com/MichMich/MagicMirror/issues/1572) - Fix null dereference in moduleNeedsUpdate when the module isn't visible - Calendar: Fixed event end times by setting default calendarEndTime to "LT" (Local time format). [#1479] +- Calendar: Fixed missing calendar fetchers after server process restarts [#1589](https://github.com/MichMich/MagicMirror/issues/1589) ### New weather module - Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index ad83c939..a6eeb226 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -105,6 +105,13 @@ Module.register("calendar", { } this.addCalendar(calendar.url, calendar.auth, calendarConfig); + + // Trigger ADD_CALENDAR every fetchInterval to make sure there is always a calendar + // fetcher running on the server side. + var self = this; + setInterval(function() { + self.addCalendar(calendar.url, calendar.auth, calendarConfig); + }, self.config.fetchInterval); } this.calendarData = {}; From 3a034ecec8f8dc30fc3addb0df58757d440ded18 Mon Sep 17 00:00:00 2001 From: vincep5 Date: Tue, 26 Feb 2019 14:06:00 -0600 Subject: [PATCH 085/116] Adding new weather provider for weather.gov --- CHANGELOG.md | 1 + modules/default/weather/README.md | 13 +- .../default/weather/providers/weathergov.js | 268 ++++++++++++++++++ 3 files changed, 280 insertions(+), 2 deletions(-) create mode 100644 modules/default/weather/providers/weathergov.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e7ae65d..c79358c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Added fade, fadePoint and maxNumberOfDays properties to the forecast mode [#1516](https://github.com/MichMich/MagicMirror/issues/1516) - Fixed Loading string and decimalSymbol string replace [#1538](https://github.com/MichMich/MagicMirror/issues/1538) - Show Snow amounts in new weather module [#1545](https://github.com/MichMich/MagicMirror/issues/1545) +- Added weather.gov as a new weather provider for US locations ## [2.6.0] - 2019-01-01 diff --git a/modules/default/weather/README.md b/modules/default/weather/README.md index d15a208f..1d4a129f 100644 --- a/modules/default/weather/README.md +++ b/modules/default/weather/README.md @@ -81,7 +81,7 @@ The following properties can be configured: | ---------------------------- | ----------- | `apiVersion` | The OpenWeatherMap API version to use.

**Default value:** `2.5` | `apiBase` | The OpenWeatherMap base URL.

**Default value:** `'http://api.openweathermap.org/data/'` -| `weatherEndpoint` | The OpenWeatherMap API endPoint.

**Possible values:** `/weather`, `/forecast` (free users) or `/forecast/daily` (paying users or old apiKey only)
**Default value:** `'/weather'` +| `weatherEndpoint` | The OpenWeatherMap API endPoint.

**Possible values:** `/weather`, `/forecast` (free users) or `/forecast/daily` (paying users or old apiKey only)
**Default value:** `'/weather'` | `locationID` | Location ID from [OpenWeatherMap](https://openweathermap.org/find) **This will override anything you put in location.**
Leave blank if you want to use location.
**Example:** `1234567`
**Default value:** `false`

**Note:** When the `location` and `locationID` are both not set, the location will be based on the information provided by the calendar module. The first upcoming event with location data will be used. | `location` | The location used for weather information.

**Example:** `'Amsterdam,Netherlands'`
**Default value:** `false`

**Note:** When the `location` and `locationID` are both not set, the location will be based on the information provided by the calendar module. The first upcoming event with location data will be used. | `apiKey` | The [OpenWeatherMap](https://home.openweathermap.org) API key, which can be obtained by creating an OpenWeatherMap account.

This value is **REQUIRED** @@ -91,11 +91,20 @@ The following properties can be configured: | Option | Description | ---------------------------- | ----------- | `apiBase` | The DarkSky base URL. The darksky api has disabled [cors](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), therefore a proxy is required.

**Possible value:** `'https://cors-anywhere.herokuapp.com/https://api.darksky.net'`
This value is **REQUIRED** -| `weatherEndpoint` | The DarkSky API endPoint.

**Possible values:** `/forecast`
This value is **REQUIRED** +| `weatherEndpoint` | The DarkSky API endPoint.

**Possible values:** `/forecast`
This value is **REQUIRED** | `apiKey` | The [DarkSky](https://darksky.net/dev/register) API key, which can be obtained by creating an DarkSky account.

This value is **REQUIRED** | `lat` | The geo coordinate latitude.

This value is **REQUIRED** | `lon` | The geo coordinate longitude.

This value is **REQUIRED** +### Weather.gov options + +| Option | Description +| ---------------------------- | ----------- +| `apiBase` | The weather.gov base URL.

**Possible value:** `'https://api.weather.gov/points/'`
This value is **REQUIRED** +| `weatherEndpoint` | The weather.gov API endPoint.

**Possible values:** `/forecast` for forecast and `/forecast/hourly` for current.
This value is **REQUIRED** +| `lat` | The geo coordinate latitude.

This value is **REQUIRED** +| `lon` | The geo coordinate longitude.

This value is **REQUIRED** + ## API Provider Development If you want to add another API provider checkout the [Guide](providers). diff --git a/modules/default/weather/providers/weathergov.js b/modules/default/weather/providers/weathergov.js new file mode 100644 index 00000000..7a313749 --- /dev/null +++ b/modules/default/weather/providers/weathergov.js @@ -0,0 +1,268 @@ +/* global WeatherProvider, WeatherObject */ + +/* Magic Mirror + * Module: Weather + * Provider: weather.gov + * + * By Vince Peri + * MIT Licensed. + * + * This class is a provider for weather.gov. + * Note that this is only for US locations (lat and lon) and does not require an API key + * Since it is free, there are some items missing - like sunrise, sunset, humidity, etc. + */ + +WeatherProvider.register("weathergov", { + + // Set the name of the provider. + // This isn't strictly necessary, since it will fallback to the provider identifier + // But for debugging (and future alerts) it would be nice to have the real name. + providerName: "Weather.gov", + + // Overwrite the fetchCurrentWeather method. + fetchCurrentWeather() { + this.fetchData(this.getUrl()) + .then(data => { + if (!data || !data.properties || !data.properties.periods || !data.properties.periods.length) { + // Did not receive usable new data. + // Maybe this needs a better check? + return; + } + + //this.setFetchedLocation(`${data.name}, ${data.sys.country}`); + + const currentWeather = this.generateWeatherObjectFromCurrentWeather(data.properties.periods[0]); + this.setCurrentWeather(currentWeather); + }) + .catch(function(request) { + Log.error("Could not load data ... ", request); + }) + }, + + // Overwrite the fetchCurrentWeather method. + fetchWeatherForecast() { + this.fetchData(this.getUrl()) + .then(data => { + if (!data || !data.properties || !data.properties.periods || !data.properties.periods.length) { + // Did not receive usable new data. + // Maybe this needs a better check? + return; + } + + //this.setFetchedLocation(`${data.city.name}, ${data.city.country}`); + + const forecast = this.generateWeatherObjectsFromForecast(data.properties.periods); + this.setWeatherForecast(forecast); + }) + .catch(function(request) { + Log.error("Could not load data ... ", request); + }) + }, + + /** Weather.gov Specific Methods - These are not part of the default provider methods */ + /* + * Gets the complete url for the request + */ + getUrl() { + return this.config.apiBase + this.config.lat + "," + this.config.lon + this.config.weatherEndpoint; + }, + + /* + * Generate a WeatherObject based on currentWeatherInformation + */ + generateWeatherObjectFromCurrentWeather(currentWeatherData) { + const currentWeather = new WeatherObject(this.config.units); + + //currentWeather.humidity = currentWeatherData.main.humidity; + currentWeather.temperature = currentWeatherData.temperature; + currentWeather.windSpeed = currentWeatherData.windSpeed.split(" ", 1); + currentWeather.windDirection = this.convertDirectiontoDegrees(currentWeatherData.windDirection); + currentWeather.weatherType = this.convertWeatherType(currentWeatherData.shortForecast, currentWeatherData.isDaytime); + //currentWeather.sunrise = moment(currentWeatherData.sys.sunrise, "X"); + //currentWeather.sunset = moment(currentWeatherData.sys.sunset, "X"); + + return currentWeather; + }, + + /* + * Generate WeatherObjects based on forecast information + */ + generateWeatherObjectsFromForecast(forecasts) { + return this.fetchForecastDaily(forecasts); + }, + + /* + * fetch forecast information for daily forecast. + */ + fetchForecastDaily(forecasts) { + // initial variable declaration + const days = []; + // variables for temperature range and rain + var minTemp = []; + var maxTemp = []; + // variable for date + let date = ""; + var weather = new WeatherObject(this.config.units); + weather.precipitation = 0; + + for (const forecast of forecasts) { + + if (date !== moment(forecast.startTime).format("YYYY-MM-DD")) { + + // calculate minimum/maximum temperature, specify rain amount + weather.minTemperature = Math.min.apply(null, minTemp); + weather.maxTemperature = Math.max.apply(null, maxTemp); + + // push weather information to days array + days.push(weather); + // create new weather-object + weather = new WeatherObject(this.config.units); + + minTemp = []; + maxTemp = []; + weather.precipitation = 0; + + // set new date + date = moment(forecast.startTime).format("YYYY-MM-DD"); + + // specify date + weather.date = moment(forecast.startTime); + + // If the first value of today is later than 17:00, we have an icon at least! + weather.weatherType = this.convertWeatherType(forecast.shortForecast, forecast.isDaytime); + } + + if (moment(forecast.startTime).format("H") >= 8 && moment(forecast.startTime).format("H") <= 17) { + weather.weatherType = this.convertWeatherType(forecast.shortForecast, forecast.isDaytime); + } + + // the same day as before + // add values from forecast to corresponding variables + minTemp.push(forecast.temperature); + maxTemp.push(forecast.temperature); + } + + // last day + // calculate minimum/maximum temperature, specify rain amount + weather.minTemperature = Math.min.apply(null, minTemp); + weather.maxTemperature = Math.max.apply(null, maxTemp); + + // push weather information to days array + days.push(weather); + return days.slice(1); + }, + + /* + * Convert the icons to a more usable name. + */ + convertWeatherType(weatherType, isDaytime) { + //https://w1.weather.gov/xml/current_obs/weather.php + // There are way too many types to create, so lets just look for certain strings + + if (weatherType.includes("Cloudy") || weatherType.includes("Partly")) { + if (isDaytime) { + return "day-cloudy"; + } else { + return "night-cloudy"; + } + } else if (weatherType.includes("Overcast")) { + if (isDaytime) { + return "cloudy"; + } else { + return "night-cloudy"; + } + } else if (weatherType.includes("Freezing") || weatherType.includes("Ice")) { + return "rain-mix"; + } else if (weatherType.includes("Snow")) { + if (isDaytime) { + return "snow"; + } else { + return "night-snow"; + } + } else if (weatherType.includes("Thunderstorm")) { + if (isDaytime) { + return "thunderstorm"; + } else { + return "night-thunderstorm"; + } + } else if (weatherType.includes("Showers")) { + if (isDaytime) { + return "showers"; + } else { + return "night-showers"; + } + } else if (weatherType.includes("Rain")) { + if (isDaytime) { + return "rain"; + } else { + return "night-rain"; + } + } else if (weatherType.includes("Breezy") || weatherType.includes("Windy")) { + if (isDaytime) { + return "cloudy-windy"; + } else { + return "night-alt-cloudy-windy"; + } + } else if (weatherType.includes("Fair") || weatherType.includes("Clear") || weatherType.includes("Few")) { + if (isDaytime) { + return "day-sunny"; + } else { + return "night-clear"; + } + } else if (weatherType.includes("Fog")) { + return "fog"; + } else if (weatherType.includes("Smoke")) { + return "smoke"; + } else if (weatherType.includes("Haze")) { + return "day-haze"; + } + + return null; + }, + + /* getParams(compliments) + * Generates an url with api parameters based on the config. + * + * return String - URL params. + */ + getParams() { + + }, + + /* + Convert the direction into Degrees + */ + convertDirectiontoDegrees(direction) { + if (direction === "NNE"){ + return 33.75; + } else if (direction === "NE") { + return 56.25; + } else if (direction === "ENE") { + return 78.75; + } else if (direction === "E") { + return 101.25; + } else if (direction === "ESE") { + return 123.75; + } else if (direction === "SE") { + return 146.25; + } else if (direction === "SSE") { + return 168.75; + } else if (direction === "S") { + return 191.25; + } else if (direction === "SSW") { + return 213.75; + } else if (direction === "SW") { + return 236.25; + } else if (direction === "WSW") { + return 258.75; + } else if (direction === "W") { + return 281.25; + } else if (direction === "WNW") { + return 303.75; + } else if (direction === "NW") { + return 326.25; + } else if (direction === "NNW") { + return 348.75; + } + } +}); From d8765578c867c203c990202ac76919058d52abfe Mon Sep 17 00:00:00 2001 From: vincep5 Date: Tue, 26 Feb 2019 14:51:09 -0600 Subject: [PATCH 086/116] weather.gov N arrow --- modules/default/weather/providers/weathergov.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/default/weather/providers/weathergov.js b/modules/default/weather/providers/weathergov.js index 7a313749..ac38932b 100644 --- a/modules/default/weather/providers/weathergov.js +++ b/modules/default/weather/providers/weathergov.js @@ -263,6 +263,8 @@ WeatherProvider.register("weathergov", { return 326.25; } else if (direction === "NNW") { return 348.75; + } else { + return 0; } } }); From e4891e699f2dfa8db2cd9359e66024b9a1dd04ad Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Wed, 27 Feb 2019 13:33:14 +0100 Subject: [PATCH 087/116] Revert "Added autoLocation and autoTimezone option for weather modules and clock respectively." --- CHANGELOG.md | 2 -- modules/default/clock/clock.js | 26 ++++------------- modules/default/clock/node_helper.js | 29 ------------------- .../default/currentweather/currentweather.js | 14 +-------- modules/default/currentweather/node_helper.js | 29 ------------------- .../default/weatherforecast/node_helper.js | 29 ------------------- .../weatherforecast/weatherforecast.js | 15 ++-------- 7 files changed, 8 insertions(+), 136 deletions(-) delete mode 100644 modules/default/clock/node_helper.js delete mode 100644 modules/default/currentweather/node_helper.js delete mode 100644 modules/default/weatherforecast/node_helper.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e7ae65d..b42a99c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,8 +15,6 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Italian translation for "Feels" - Disabled the screensaver on raspbian with installation script - Added option to truncate the number of vertical lines a calendar item can span if `wrapEvents` is enabled. -- Added autoLocation options for weather forcast and current weather modules. -- Added autoTimezone option for the default clock module. - Danish translation for "Feels" and "Weeks" - Added option to split multiple day events in calendar to separate numbered events - Slovakian translation diff --git a/modules/default/clock/clock.js b/modules/default/clock/clock.js index 03528bce..23b801d0 100644 --- a/modules/default/clock/clock.js +++ b/modules/default/clock/clock.js @@ -26,7 +26,6 @@ Module.register("clock",{ analogShowDate: "top", // options: false, 'top', or 'bottom' secondsColor: "#888888", timezone: null, - autoTimezone: false }, // Define required scripts. getScripts: function() { @@ -40,31 +39,16 @@ Module.register("clock",{ start: function() { Log.info("Starting module: " + this.name); - if (this.config.autoTimezone) { - this.sendSocketNotification("AUTO_TIMEZONE"); - } else { - // Schedule update interval. - var self = this; - setInterval(function() { - self.updateDom(); - }, 1000); - } + // Schedule update interval. + var self = this; + setInterval(function() { + self.updateDom(); + }, 1000); // Set locale. moment.locale(config.language); }, - - socketNotificationReceived: function (notification, payload) { - if (notification === "UPDATE_TIMEZONE") { - var self = this; - self.config.timezone = payload.timezone; - setInterval(function() { - self.updateDom(); - }, 1000); - } - }, - // Override dom generator. getDom: function() { diff --git a/modules/default/clock/node_helper.js b/modules/default/clock/node_helper.js deleted file mode 100644 index 68258b0a..00000000 --- a/modules/default/clock/node_helper.js +++ /dev/null @@ -1,29 +0,0 @@ -var http = require("http"); -var NodeHelper = require("node_helper"); - -module.exports = NodeHelper.create({ - start: function () { - }, - - socketNotificationReceived: function (notification, payload) { - var self = this; - - if (notification === "AUTO_TIMEZONE") { - console.log("Loading timezone..."); - http.get("http://ip-api.com/json", function (req) { - var data = ""; - req.on("data", function (d) { - data += d; - }); - req.on("end", function () { - var body = JSON.parse(data); - payload.timezone = body.timezone; - self.sendSocketNotification("UPDATE_TIMEZONE", payload); - }); - }).on("error", function () { - payload.error = "Could not figure out the timezone."; - self.sendSocketNotification("UPDATE_TIMEZONE", payload); - }); - } - } -}); diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 0472b7a1..2a6d24b9 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -11,7 +11,6 @@ Module.register("currentweather",{ // Default module config. defaults: { - autoLocation: false, location: false, locationID: false, appid: "", @@ -110,19 +109,8 @@ Module.register("currentweather",{ this.weatherType = null; this.feelsLike = null; this.loaded = false; + this.scheduleUpdate(this.config.initialLoadDelay); - if (this.config.autoLocation) { - this.sendSocketNotification("AUTO_LOCATION"); - } else { - this.scheduleUpdate(this.config.initialLoadDelay); - } - }, - - socketNotificationReceived: function (notification, payload) { - if (notification === "UPDATE_LOCATION") { - this.config.location = payload.location; - this.scheduleUpdate(this.config.initialLoadDelay); - } }, // add extra information of current weather diff --git a/modules/default/currentweather/node_helper.js b/modules/default/currentweather/node_helper.js deleted file mode 100644 index 53956f62..00000000 --- a/modules/default/currentweather/node_helper.js +++ /dev/null @@ -1,29 +0,0 @@ -var http = require("http"); -var NodeHelper = require("node_helper"); - -module.exports = NodeHelper.create({ - start: function () { - }, - - socketNotificationReceived: function (notification, payload) { - var self = this; - - if (notification === "AUTO_LOCATION") { - console.log("Loading timezone..."); - http.get("http://ip-api.com/json", function (req) { - var data = ""; - req.on("data", function (d) { - data += d; - }); - req.on("end", function () { - var body = JSON.parse(data); - payload.location = body.city + ", " + body.regionName; - self.sendSocketNotification("UPDATE_LOCATION", payload); - }); - }).on("error", function () { - payload.error = "Could not figure out the timezone."; - self.sendSocketNotification("UPDATE_LOCATION", payload); - }); - } - } -}); diff --git a/modules/default/weatherforecast/node_helper.js b/modules/default/weatherforecast/node_helper.js deleted file mode 100644 index 53956f62..00000000 --- a/modules/default/weatherforecast/node_helper.js +++ /dev/null @@ -1,29 +0,0 @@ -var http = require("http"); -var NodeHelper = require("node_helper"); - -module.exports = NodeHelper.create({ - start: function () { - }, - - socketNotificationReceived: function (notification, payload) { - var self = this; - - if (notification === "AUTO_LOCATION") { - console.log("Loading timezone..."); - http.get("http://ip-api.com/json", function (req) { - var data = ""; - req.on("data", function (d) { - data += d; - }); - req.on("end", function () { - var body = JSON.parse(data); - payload.location = body.city + ", " + body.regionName; - self.sendSocketNotification("UPDATE_LOCATION", payload); - }); - }).on("error", function () { - payload.error = "Could not figure out the timezone."; - self.sendSocketNotification("UPDATE_LOCATION", payload); - }); - } - } -}); diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index c32821db..67193696 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -11,7 +11,6 @@ Module.register("weatherforecast",{ // Default module config. defaults: { - autoLocation: false, location: false, locationID: false, appid: "", @@ -96,20 +95,10 @@ Module.register("weatherforecast",{ this.forecast = []; this.loaded = false; + this.scheduleUpdate(this.config.initialLoadDelay); + this.updateTimer = null; - if (this.config.autoLocation) { - this.sendSocketNotification("AUTO_LOCATION"); - } else { - this.scheduleUpdate(this.config.initialLoadDelay); - } - }, - - socketNotificationReceived: function (notification, payload) { - if (notification === "UPDATE_LOCATION") { - this.config.location = payload.location; - this.scheduleUpdate(this.config.initialLoadDelay); - } }, // Override dom generator. From ebc1e5bf129b8119aea117641e3fc2bc9931ed82 Mon Sep 17 00:00:00 2001 From: vincep5 Date: Wed, 27 Feb 2019 09:09:37 -0600 Subject: [PATCH 088/116] tidy up code for weather --- .../weather/providers/openweathermap.js | 10 ++-- .../default/weather/providers/weathergov.js | 60 +++++++------------ 2 files changed, 28 insertions(+), 42 deletions(-) diff --git a/modules/default/weather/providers/openweathermap.js b/modules/default/weather/providers/openweathermap.js index e388e278..f7fe0edc 100644 --- a/modules/default/weather/providers/openweathermap.js +++ b/modules/default/weather/providers/openweathermap.js @@ -103,13 +103,13 @@ WeatherProvider.register("openweathermap", { // initial variable declaration const days = []; // variables for temperature range and rain - var minTemp = []; - var maxTemp = []; - var rain = 0; - var snow = 0; + let minTemp = []; + let maxTemp = []; + let rain = 0; + let snow = 0; // variable for date let date = ""; - var weather = new WeatherObject(this.config.units); + let weather = new WeatherObject(this.config.units); for (const forecast of forecasts) { diff --git a/modules/default/weather/providers/weathergov.js b/modules/default/weather/providers/weathergov.js index ac38932b..1110c68e 100644 --- a/modules/default/weather/providers/weathergov.js +++ b/modules/default/weather/providers/weathergov.js @@ -29,8 +29,6 @@ WeatherProvider.register("weathergov", { return; } - //this.setFetchedLocation(`${data.name}, ${data.sys.country}`); - const currentWeather = this.generateWeatherObjectFromCurrentWeather(data.properties.periods[0]); this.setCurrentWeather(currentWeather); }) @@ -49,8 +47,6 @@ WeatherProvider.register("weathergov", { return; } - //this.setFetchedLocation(`${data.city.name}, ${data.city.country}`); - const forecast = this.generateWeatherObjectsFromForecast(data.properties.periods); this.setWeatherForecast(forecast); }) @@ -73,13 +69,10 @@ WeatherProvider.register("weathergov", { generateWeatherObjectFromCurrentWeather(currentWeatherData) { const currentWeather = new WeatherObject(this.config.units); - //currentWeather.humidity = currentWeatherData.main.humidity; currentWeather.temperature = currentWeatherData.temperature; currentWeather.windSpeed = currentWeatherData.windSpeed.split(" ", 1); currentWeather.windDirection = this.convertDirectiontoDegrees(currentWeatherData.windDirection); currentWeather.weatherType = this.convertWeatherType(currentWeatherData.shortForecast, currentWeatherData.isDaytime); - //currentWeather.sunrise = moment(currentWeatherData.sys.sunrise, "X"); - //currentWeather.sunset = moment(currentWeatherData.sys.sunset, "X"); return currentWeather; }, @@ -98,11 +91,11 @@ WeatherProvider.register("weathergov", { // initial variable declaration const days = []; // variables for temperature range and rain - var minTemp = []; - var maxTemp = []; + let minTemp = []; + let maxTemp = []; // variable for date let date = ""; - var weather = new WeatherObject(this.config.units); + let weather = new WeatherObject(this.config.units); weather.precipitation = 0; for (const forecast of forecasts) { @@ -162,53 +155,55 @@ WeatherProvider.register("weathergov", { if (weatherType.includes("Cloudy") || weatherType.includes("Partly")) { if (isDaytime) { return "day-cloudy"; - } else { - return "night-cloudy"; } + + return "night-cloudy"; } else if (weatherType.includes("Overcast")) { if (isDaytime) { return "cloudy"; - } else { - return "night-cloudy"; } + + return "night-cloudy"; } else if (weatherType.includes("Freezing") || weatherType.includes("Ice")) { return "rain-mix"; } else if (weatherType.includes("Snow")) { if (isDaytime) { return "snow"; - } else { - return "night-snow"; } + + return "night-snow"; } else if (weatherType.includes("Thunderstorm")) { if (isDaytime) { return "thunderstorm"; - } else { - return "night-thunderstorm"; } + + return "night-thunderstorm"; } else if (weatherType.includes("Showers")) { if (isDaytime) { return "showers"; - } else { - return "night-showers"; } - } else if (weatherType.includes("Rain")) { + + return "night-showers"; + } else if (weatherType.includes("Rain") || weatherType.includes("Drizzle")) { if (isDaytime) { return "rain"; - } else { - return "night-rain"; } + + return "night-rain"; } else if (weatherType.includes("Breezy") || weatherType.includes("Windy")) { if (isDaytime) { return "cloudy-windy"; - } else { - return "night-alt-cloudy-windy"; } - } else if (weatherType.includes("Fair") || weatherType.includes("Clear") || weatherType.includes("Few")) { + + return "night-alt-cloudy-windy"; + } else if (weatherType.includes("Fair") || weatherType.includes("Clear") || weatherType.includes("Few") || weatherType.includes("Sunny")) { if (isDaytime) { return "day-sunny"; - } else { - return "night-clear"; } + + return "night-clear"; + } else if (weatherType.includes("Dust") || weatherType.includes("Sand")) { + return "dust"; } else if (weatherType.includes("Fog")) { return "fog"; } else if (weatherType.includes("Smoke")) { @@ -220,15 +215,6 @@ WeatherProvider.register("weathergov", { return null; }, - /* getParams(compliments) - * Generates an url with api parameters based on the config. - * - * return String - URL params. - */ - getParams() { - - }, - /* Convert the direction into Degrees */ From 8f781ea4ab206b0f9cb9c3b0784ecc843f222963 Mon Sep 17 00:00:00 2001 From: Veeck Date: Fri, 1 Mar 2019 23:34:27 +0100 Subject: [PATCH 089/116] Small typo fix in link --- modules/default/alert/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/alert/README.md b/modules/default/alert/README.md index c57ba793..e193e4ba 100644 --- a/modules/default/alert/README.md +++ b/modules/default/alert/README.md @@ -61,4 +61,4 @@ self.sendNotification("SHOW_ALERT", {}); ## Open Source Licenses ### [NotificationStyles](https://github.com/codrops/NotificationStyles) -See [ympanus.net](http://tympanus.net/codrops/licensing/) for license. +See [tympanus.net](http://tympanus.net/codrops/licensing/) for license. From d622277c11d6f5010c9f2e33e3b80b00cdffdfbf Mon Sep 17 00:00:00 2001 From: Veeck Date: Sat, 2 Mar 2019 08:40:20 +0100 Subject: [PATCH 090/116] Updated modernizr code to latest version --- CHANGELOG.md | 1 + modules/default/alert/modernizr.custom.js | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b42a99c5..3de5cb29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Updated - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) +- Updated modernizr code in alert module, fixed a small typo there too ### Fixed - Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503), [#1511](https://github.com/MichMich/MagicMirror/issues/1511). diff --git a/modules/default/alert/modernizr.custom.js b/modules/default/alert/modernizr.custom.js index 3d33a8be..83c3d3f1 100644 --- a/modules/default/alert/modernizr.custom.js +++ b/modules/default/alert/modernizr.custom.js @@ -1,5 +1,3 @@ -/* Modernizr 2.8.3 (Custom Build) | MIT & BSD - * Build: http://modernizr.com/download/#-cssanimations-shiv-cssclasses-prefixed-testprop-testallprops-domprefixes-load - */ -// jscs:disable -;window.Modernizr = function(a, b, c) {function x(a) {j.cssText = a;}function y(a, b) {return x(prefixes.join(a + ";") + (b || ""));}function z(a, b) {return typeof a === b;}function A(a, b) {return !!~("" + a).indexOf(b);}function B(a, b) {for (var d in a) {var e = a[d];if (!A(e,"-") && j[e] !== c)return b == "pfx" ? e : !0;}return !1;}function C(a, b, d) {for (var e in a) {var f = b[a[e]];if (f !== c)return d === !1 ? a[e] : z(f,"function") ? f.bind(d || b) : f;}return !1;}function D(a, b, c) {var d = a.charAt(0).toUpperCase() + a.slice(1),e = (a + " " + n.join(d + " ") + d).split(" ");return z(b,"string") || z(b,"undefined") ? B(e,b) : (e = (a + " " + o.join(d + " ") + d).split(" "),C(e,b,c));}var d = "2.8.3",e = {},f = !0,g = b.documentElement,h = "modernizr",i = b.createElement(h),j = i.style,k,l = {}.toString,m = "Webkit Moz O ms",n = m.split(" "),o = m.toLowerCase().split(" "),p = {},q = {},r = {},s = [],t = s.slice,u,v = {}.hasOwnProperty,w;!z(v,"undefined") && !z(v.call,"undefined") ? w = function(a, b) {return v.call(a,b);} : w = function(a, b) {return b in a && z(a.constructor.prototype[b],"undefined");},Function.prototype.bind || (Function.prototype.bind = function(b) {var c = this;if (typeof c != "function")throw new TypeError;var d = t.call(arguments,1),e = function() {if (this instanceof e) {var a = function() {};a.prototype = c.prototype;var f = new a,g = c.apply(f,d.concat(t.call(arguments)));return Object(g) === g ? g : f;}return c.apply(b,d.concat(t.call(arguments)));};return e;}),p.cssanimations = function() {return D("animationName");};for (var E in p)w(p,E) && (u = E.toLowerCase(),e[u] = p[E](),s.push((e[u] ? "" : "no-") + u));return e.addTest = function(a, b) {if (typeof a == "object")for (var d in a)w(a,d) && e.addTest(d,a[d]);else {a = a.toLowerCase();if (e[a] !== c)return e;b = typeof b == "function" ? b() : b,typeof f != "undefined" && f && (g.className += " " + (b ? "" : "no-") + a),e[a] = b;}return e;},x(""),i = k = null,function(a, b) {function l(a, b) {var c = a.createElement("p"),d = a.getElementsByTagName("head")[0] || a.documentElement;return c.innerHTML = "x",d.insertBefore(c.lastChild,d.firstChild);}function m() {var a = s.elements;return typeof a == "string" ? a.split(" ") : a;}function n(a) {var b = j[a[h]];return b || (b = {},i++,a[h] = i,j[i] = b),b;}function o(a, c, d) {c || (c = b);if (k)return c.createElement(a);d || (d = n(c));var g;return d.cache[a] ? g = d.cache[a].cloneNode() : f.test(a) ? g = (d.cache[a] = d.createElem(a)).cloneNode() : g = d.createElem(a),g.canHaveChildren && !e.test(a) && !g.tagUrn ? d.frag.appendChild(g) : g;}function p(a, c) {a || (a = b);if (k)return a.createDocumentFragment();c = c || n(a);var d = c.frag.cloneNode(),e = 0,f = m(),g = f.length;for (; e < g; e++)d.createElement(f[e]);return d;}function q(a, b) {b.cache || (b.cache = {},b.createElem = a.createElement,b.createFrag = a.createDocumentFragment,b.frag = b.createFrag()),a.createElement = function(c) {return s.shivMethods ? o(c,a,b) : b.createElem(c);},a.createDocumentFragment = Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + m().join().replace(/[\w\-]+/g,function(a) {return b.createElem(a),b.frag.createElement(a),"c(\"" + a + "\")";}) + ");return n}")(s,b.frag);}function r(a) {a || (a = b);var c = n(a);return s.shivCSS && !g && !c.hasCSS && (c.hasCSS = !!l(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k || q(a,c),a;}var c = "3.7.0",d = a.html5 || {},e = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,g,h = "_html5shiv",i = 0,j = {},k;(function() {try {var a = b.createElement("a");a.innerHTML = "",g = "hidden"in a,k = a.childNodes.length == 1 || function() {b.createElement("a");var a = b.createDocumentFragment();return typeof a.cloneNode == "undefined" || typeof a.createDocumentFragment == "undefined" || typeof a.createElement == "undefined";}();}catch (c) {g = !0,k = !0;}})();var s = {elements: d.elements || "abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version: c,shivCSS: d.shivCSS !== !1,supportsUnknownElements: k,shivMethods: d.shivMethods !== !1,type: "default",shivDocument: r,createElement: o,createDocumentFragment: p};a.html5 = s,r(b);}(this,b),e._version = d,e._domPrefixes = o,e._cssomPrefixes = n,e.testProp = function(a) {return B([a]);},e.testAllProps = D,e.prefixed = function(a, b, c) {return b ? D(a,b,c) : D(a,"pfx");},g.className = g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2") + (f ? " js " + s.join(" ") : ""),e;}(this,this.document),function(a, b, c) {function d(a) {return "[object Function]" == o.call(a);}function e(a) {return "string" == typeof a;}function f() {}function g(a) {return !a || "loaded" == a || "complete" == a || "uninitialized" == a;}function h() {var a = p.shift();q = 1,a ? a.t ? m(function() {("c" == a.t ? B.injectCss : B.injectJs)(a.s,0,a.a,a.x,a.e,1);},0) : (a(),h()) : q = 0;}function i(a, c, d, e, f, i, j) {function k(b) {if (!o && g(l.readyState) && (u.r = o = 1,!q && h(),l.onload = l.onreadystatechange = null,b)) {"img" != a && m(function() {t.removeChild(l);},50);for (var d in y[c])y[c].hasOwnProperty(d) && y[c][d].onload();}}var j = j || B.errorTimeout,l = b.createElement(a),o = 0,r = 0,u = {t: d,s: c,e: f,a: i,x: j};1 === y[c] && (r = 1,y[c] = []),"object" == a ? l.data = c : (l.src = c,l.type = a),l.width = l.height = "0",l.onerror = l.onload = l.onreadystatechange = function() {k.call(this,r);},p.splice(e,0,u),"img" != a && (r || 2 === y[c] ? (t.insertBefore(l,s ? null : n),m(k,j)) : y[c].push(l));}function j(a, b, c, d, f) {return q = 0,b = b || "j",e(a) ? i("c" == b ? v : u,a,b,this.i++,c,d,f) : (p.splice(this.i++,0,a),1 == p.length && h()),this;}function k() {var a = B;return a.loader = {load: j,i: 0},a;}var l = b.documentElement,m = a.setTimeout,n = b.getElementsByTagName("script")[0],o = {}.toString,p = [],q = 0,r = "MozAppearance"in l.style,s = r && !!b.createRange().compareNode,t = s ? l : n.parentNode,l = a.opera && "[object Opera]" == o.call(a.opera),l = !!b.attachEvent && !l,u = r ? "object" : l ? "script" : "img",v = l ? "script" : u,w = Array.isArray || function(a) {return "[object Array]" == o.call(a);},x = [],y = {},z = {timeout: function(a, b) {return b.length && (a.timeout = b[0]),a;}},A,B;B = function(a) {function b(a) {var a = a.split("!"),b = x.length,c = a.pop(),d = a.length,c = {url: c,origUrl: c,prefixes: a},e,f,g;for (f = 0; f < d; f++)g = a[f].split("="),(e = z[g.shift()]) && (c = e(c,g));for (f = 0; f < b; f++)c = x[f](c);return c;}function g(a, e, f, g, h) {var i = b(a),j = i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass || (e && (e = d(e) ? e : e[a] || e[g] || e[a.split("/").pop().split("?")[0]]),i.instead ? i.instead(a,e,f,g,h) : (y[i.url] ? i.noexec = !0 : y[i.url] = 1,f.load(i.url,i.forceCSS || !i.forceJS && "css" == i.url.split(".").pop().split("?").shift() ? "c" : c,i.noexec,i.attrs,i.timeout),(d(e) || d(j)) && f.load(function() {k(),e && e(i.origUrl,h,g),j && j(i.origUrl,h,g),y[i.url] = 2;})));}function h(a, b) {function c(a, c) {if (a) {if (e(a))c || (j = function() {var a = [].slice.call(arguments);k.apply(this,a),l();}),g(a,j,b,0,h);else if (Object(a) === a)for (n in m = function() {var b = 0,c;for (c in a)a.hasOwnProperty(c) && b++;return b;}(),a)a.hasOwnProperty(n) && (!c && !--m && (d(j) ? j = function() {var a = [].slice.call(arguments);k.apply(this,a),l();} : j[n] = function(a) {return function() {var b = [].slice.call(arguments);a && a.apply(this,b),l();};}(k[n])),g(a[n],j,b,n,h));}else !c && l();}var h = !!a.test,i = a.load || a.both,j = a.callback || f,k = j,l = a.complete || f,m,n;c(h ? a.yep : a.nope,!!i),i && c(i);}var i,j,l = this.yepnope.loader;if (e(a))g(a,0,l,0);else if (w(a))for (i = 0; i < a.length; i++)j = a[i],e(j) ? g(j,0,l,0) : w(j) ? B(j) : Object(j) === j && h(j,l);else Object(a) === a && h(a,l);},B.addPrefix = function(a, b) {z[a] = b;},B.addFilter = function(a) {x.push(a);},B.errorTimeout = 1e4,null == b.readyState && b.addEventListener && (b.readyState = "loading",b.addEventListener("DOMContentLoaded",A = function() {b.removeEventListener("DOMContentLoaded",A,0),b.readyState = "complete";},0)),a.yepnope = k(),a.yepnope.executeStack = h,a.yepnope.injectJs = function(a, c, d, e, i, j) {var k = b.createElement("script"),l,o,e = e || B.errorTimeout;k.src = a;for (o in d)k.setAttribute(o,d[o]);c = j ? h : c || f,k.onreadystatechange = k.onload = function() {!l && g(k.readyState) && (l = 1,c(),k.onload = k.onreadystatechange = null);},m(function() {l || (l = 1,c(1));},e),i ? k.onload() : n.parentNode.insertBefore(k,n);},a.yepnope.injectCss = function(a, c, d, e, g, i) {var e = b.createElement("link"),j,c = i ? h : c || f;e.href = a,e.rel = "stylesheet",e.type = "text/css";for (j in d)e.setAttribute(j,d[j]);g || (n.parentNode.insertBefore(e,n),m(c,0));};}(this,document),Modernizr.load = function() {yepnope.apply(window,[].slice.call(arguments,0));}; +/*! modernizr 3.7.0 (Custom Build) | MIT * + * https://modernizr.com/download/?-cssanimations-domprefixes-prefixed-setclasses-shiv-testallprops-testprop !*/ +!function(e,t,n){function r(e,t){return typeof e===t}function o(e,t){return!!~(""+e).indexOf(t)}function i(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):E?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}function a(){var e=t.body;return e||(e=i(E?"svg":"body"),e.fake=!0),e}function s(e,n,r,o){var s,l,c,u,f="modernizr",d=i("div"),p=a();if(parseInt(r,10))for(;r--;)c=i("div"),c.id=o?o[r]:f+(r+1),d.appendChild(c);return s=i("style"),s.type="text/css",s.id="s"+f,(p.fake?p:d).appendChild(s),p.appendChild(d),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(t.createTextNode(e)),d.id=f,p.fake&&(p.style.background="",p.style.overflow="hidden",u=S.style.overflow,S.style.overflow="hidden",S.appendChild(p)),l=n(d,e),p.fake?(p.parentNode.removeChild(p),S.style.overflow=u,S.offsetHeight):d.parentNode.removeChild(d),!!l}function l(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function c(t,n,r){var o;if("getComputedStyle"in e){o=getComputedStyle.call(e,t,n);var i=e.console;if(null!==o)r&&(o=o.getPropertyValue(r));else if(i){var a=i.error?"error":"log";i[a].call(i,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}}else o=!n&&t.currentStyle&&t.currentStyle[r];return o}function u(t,r){var o=t.length;if("CSS"in e&&"supports"in e.CSS){for(;o--;)if(e.CSS.supports(l(t[o]),r))return!0;return!1}if("CSSSupportsRule"in e){for(var i=[];o--;)i.push("("+l(t[o])+":"+r+")");return i=i.join(" or "),s("@supports ("+i+") { #modernizr { position: absolute; } }",function(e){return"absolute"===c(e,null,"position")})}return n}function f(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function d(e,t,a,s){function l(){d&&(delete N.style,delete N.modElem)}if(s=!r(s,"undefined")&&s,!r(a,"undefined")){var c=u(e,a);if(!r(c,"undefined"))return c}for(var d,p,m,h,v,g=["modernizr","tspan","samp"];!N.style&&g.length;)d=!0,N.modElem=i(g.shift()),N.style=N.modElem.style;for(m=e.length,p=0;p",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=y.elements;return"string"==typeof e?e.split(" "):e}function o(e,t){var n=y.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof e&&(e=e.join(" ")),y.elements=n+" "+e,c(t)}function i(e){var t=g[e[h]];return t||(t={},v++,e[h]=v,g[v]=t),t}function a(e,n,r){if(n||(n=t),f)return n.createElement(e);r||(r=i(n));var o;return o=r.cache[e]?r.cache[e].cloneNode():m.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),!o.canHaveChildren||p.test(e)||o.tagUrn?o:r.frag.appendChild(o)}function s(e,n){if(e||(e=t),f)return e.createDocumentFragment();n=n||i(e);for(var o=n.frag.cloneNode(),a=0,s=r(),l=s.length;a",u="hidden"in e,f=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return void 0===e.cloneNode||void 0===e.createDocumentFragment||void 0===e.createElement}()}catch(e){u=!0,f=!0}}();var y={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:"3.7.3",shivCSS:!1!==d.shivCSS,supportsUnknownElements:f,shivMethods:!1!==d.shivMethods,type:"default",shivDocument:c,createElement:a,createDocumentFragment:s,addElements:o};e.html5=y,c(t),"object"==typeof module&&module.exports&&(module.exports=y)}(void 0!==e?e:this,t);var w=y._config.usePrefixes?x.split(" "):[];y._cssomPrefixes=w;var _={elem:i("modernizr")};Modernizr._q.push(function(){delete _.elem});var N={style:_.elem.style};Modernizr._q.unshift(function(){delete N.style}),y.testAllProps=h;var j=function(t){var r,o=prefixes.length,i=e.CSSRule;if(void 0===i)return n;if(!t)return!1;if(t=t.replace(/^@/,""),(r=t.replace(/-/g,"_").toUpperCase()+"_RULE")in i)return"@"+t;for(var a=0;a0&&(t+=" "+n+e.join(" "+n)),E?S.className.baseVal=t:S.className=t)}(C),delete y.addTest,delete y.addAsyncTest;for(var z=0;z Date: Wed, 6 Mar 2019 10:01:44 +0100 Subject: [PATCH 091/116] Show more verbose error message on console if the config is malformed --- CHANGELOG.md | 1 + js/app.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3de5cb29..7e1d93e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Updated - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) - Updated modernizr code in alert module, fixed a small typo there too +- More verbose error message on console if the config is malformed ### Fixed - Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503), [#1511](https://github.com/MichMich/MagicMirror/issues/1511). diff --git a/js/app.js b/js/app.js index bfec5baf..95c9693b 100644 --- a/js/app.js +++ b/js/app.js @@ -70,7 +70,7 @@ var App = function() { if (e.code == "ENOENT") { console.error(Utils.colors.error("WARNING! Could not find config file. Please create one. Starting with default configuration.")); } else if (e instanceof ReferenceError || e instanceof SyntaxError) { - console.error(Utils.colors.error("WARNING! Could not validate config file. Please correct syntax errors. Starting with default configuration.")); + console.error(Utils.colors.error("WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: " + e.stack)); } else { console.error(Utils.colors.error("WARNING! Could not load config file. Starting with default configuration. Error found: " + e)); } From bdc5c8f6205633fb0129d2a7654334deef54ed91 Mon Sep 17 00:00:00 2001 From: Veeck Date: Wed, 6 Mar 2019 10:02:01 +0100 Subject: [PATCH 092/116] Fix typos in changelog --- CHANGELOG.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e1d93e5..568333c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503), [#1511](https://github.com/MichMich/MagicMirror/issues/1511). -- Fixed unhandled error on bad git data in updatenotiifcation module [#1285](https://github.com/MichMich/MagicMirror/issues/1285). +- Fixed unhandled error on bad git data in updatenotification module [#1285](https://github.com/MichMich/MagicMirror/issues/1285). - Weather forecast now works with openweathermap in new weather module. Daily data are displayed, see issue [#1504](https://github.com/MichMich/MagicMirror/issues/1504). - Fixed analogue clock border display issue where non-black backgrounds used (previous fix for issue 611) - Fixed compatibility issues caused when modules request different versions of Font Awesome, see issue [#1522](https://github.com/MichMich/MagicMirror/issues/1522). MagicMirror now uses [Font Awesome 5 with v4 shims included for backwards compatibility](https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#shims). @@ -108,7 +108,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Fixed gzip encoded calendar loading issue #1400. - Mixup between german and spanish translation for newsfeed. - Fixed close dates to be absolute, if no configured in the config.js - module Calendar -- Fixed the UpdateNotification module message about new commits in the repository, so they can be correctly localized in singular and plural form. +- Fixed the updatenotification module message about new commits in the repository, so they can be correctly localized in singular and plural form. - Fix for weatherforecast rainfall rounding [#1374](https://github.com/MichMich/MagicMirror/issues/1374) - Fix calendar parsing issue for Midori on RasperryPi Zero w, related to issue #694. - Fix weather city ID link in sample config @@ -258,7 +258,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Add `clientonly` script to start only the electron client for a remote server. - Add symbol and color properties of event when `CALENDAR_EVENTS` notification is broadcasted from `default/calendar` module. - Add `.vscode/` folder to `.gitignore` to keep custom Visual Studio Code config out of git. -- Add unit test the capitalizeFirstLetter function of newfeed module. +- Add unit test the capitalizeFirstLetter function of newsfeed module. - Add new unit tests for function `shorten` in calendar module. - Add new unit tests for function `getLocaleSpecification` in calendar module. - Add unit test for js/class.js. @@ -279,7 +279,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Set version of the `express-ipfilter` on 0.3.1. ### Fixed -- Fixed issue with incorrect allignment of analog clock when displayed in the center column of the MM. +- Fixed issue with incorrect alignment of analog clock when displayed in the center column of the MM. - Fixed ipWhitelist behaviour to make empty whitelist ([]) allow any and all hosts access to the MM. - Fixed issue with calendar module where 'excludedEvents' count towards 'maximumEntries'. - Fixed issue with calendar module where global configuration of maximumEntries was not overridden by calendar specific config (see module doc). @@ -303,7 +303,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Add unit test calendar_modules function capFirst. - Add test for check if exists the directories present in defaults modules. - Add support for showing wind direction as an arrow instead of abbreviation in currentWeather module. -- Add support for writing translation fucntions to support flexible word order +- Add support for writing translation functions to support flexible word order - Add test for check if exits the directories present in defaults modules. - Add calendar option to set a separate date format for full day events. - Add ability for `currentweather` module to display indoor temperature via INDOOR_TEMPERATURE notification @@ -322,7 +322,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Fix double message about port when server is starting - Corrected Swedish translations for TODAY/TOMORROW/DAYAFTERTOMORROW. - Removed unused import from js/electron.js -- Made calendar.js respect config.timeFormat irrespecive of locale setting. +- Made calendar.js respect config.timeFormat irrespective of locale setting. - Fixed alignment of analog clock when a large calendar is displayed in the same side bar. ## [2.1.1] - 2017-04-01 @@ -340,7 +340,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Added `DAYAFTERTOMORROW`, `UPDATE_NOTIFICATION` and `UPDATE_NOTIFICATION_MODULE` to Finnish translations. - Run `npm test` on Travis automatically. - Show the splash screen image even when is reboot or halted. -- Added some missing translaton strings in the sv.json file. +- Added some missing translation strings in the sv.json file. - Run task jsonlint to check translation files. - Restructured Test Suite. @@ -357,12 +357,12 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Option to use RegExp in Calendar's titleReplace. - Hungarian Translation. - Icelandic Translation. -- Add use a script to prevent when is run by SSH session set DISPLAY enviroment. -- Enable ability to set configuration file by the enviroment variable called MM_CONFIG_FILE. +- Add use a script to prevent when is run by SSH session set DISPLAY environment. +- Enable ability to set configuration file by the environment variable called MM_CONFIG_FILE. - Option to give each calendar a different color. - Option for colored min-temp and max-temp. - Add test e2e helloworld. -- Add test e2e enviroment. +- Add test e2e environment. - Add `chai-as-promised` npm module to devDependencies. - Basic set of tests for clock module. - Run e2e test in Travis. @@ -380,10 +380,10 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Added tests for Translations, dev argument, version, dev console. - Added test anytime feature compliments module. - Added test ipwhitelist configuration directive. -- Added test for calendar module: default, basic-auth, backward compability, fail-basic-auth. +- Added test for calendar module: default, basic-auth, backward compatibility, fail-basic-auth. - Added meta tags to support fullscreen mode on iOS (for server mode) - Added `ignoreOldItems` and `ignoreOlderThan` options to the News Feed module -- Added test for MM_PORT enviroment variable. +- Added test for MM_PORT environment variable. - Added a configurable Week section to the clock module. ### Fixed @@ -395,7 +395,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Module currentWeather: check if temperature received from api is defined. - Fix an issue with module hidden status changing to `true` although lock string prevented showing it. - Fix newsfeed module bug (removeStartTags) -- Fix when is set MM_PORT enviroment variable. +- Fix when is set MM_PORT environment variable. - Fixed missing animation on `this.show(speed)` when module is alone in a region. ## [2.1.0] - 2016-12-31 @@ -417,8 +417,8 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Calendar module now broadcasts the event list to all other modules using the notification system. [See documentation](https://github.com/MichMich/MagicMirror/tree/develop/modules/default/calendar) for more information. - Possibility to use the the calendar feed as the source for the weather (currentweather & weatherforecast) location data. [See documentation](https://github.com/MichMich/MagicMirror/tree/develop/modules/default/weatherforecast) for more information. - Added option to show rain amount in the weatherforecast default module -- Add module `updatenotification` to get an update whenever a new version is availabe. [See documentation](https://github.com/MichMich/MagicMirror/tree/develop/modules/default/updatenotification) for more information. -- Add the abilty to set timezone on the date display in the Clock Module +- Add module `updatenotification` to get an update whenever a new version is available. [See documentation](https://github.com/MichMich/MagicMirror/tree/develop/modules/default/updatenotification) for more information. +- Add the ability to set timezone on the date display in the Clock Module - Ability to set date format in calendar module - Possibility to use currentweather for the compliments - Added option `disabled` for modules. @@ -457,7 +457,7 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Added ability to define "the day after tomorrow" for calendar events (Definition for German and Dutch already included). - Added CII Badge (we are compliant with the CII Best Practices) - Add support for doing http basic auth when loading calendars -- Add the abilty to turn off and on the date display in the Clock Module +- Add the ability to turn off and on the date display in the Clock Module ### Fixed - Fix typo in installer. @@ -480,8 +480,8 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we ### Fixed - Prevent `getModules()` selectors from returning duplicate entries. -- Append endpoints of weather modules with `/` to retreive the correct data. (Issue [#337](https://github.com/MichMich/MagicMirror/issues/337)) -- Corrected grammer in `module.js` from 'suspend' to 'suspended'. +- Append endpoints of weather modules with `/` to retrieve the correct data. (Issue [#337](https://github.com/MichMich/MagicMirror/issues/337)) +- Corrected grammar in `module.js` from 'suspend' to 'suspended'. - Fixed openweathermap.org URL in config sample. - Prevent currentweather module from crashing when received data object is incorrect. - Fix issue where translation loading prevented the UI start-up when the language was set to 'en'. (Issue [#388](https://github.com/MichMich/MagicMirror/issues/388)) From bc4e0190a0007cf3dd3161b785963cc7a9c8d31a Mon Sep 17 00:00:00 2001 From: vincep5 Date: Wed, 6 Mar 2019 21:33:13 -0600 Subject: [PATCH 093/116] readme formatting --- modules/default/weather/README.md | 48 ++++++++++----------- modules/default/weather/providers/README.md | 2 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/modules/default/weather/README.md b/modules/default/weather/README.md index 1d4a129f..1b406958 100644 --- a/modules/default/weather/README.md +++ b/modules/default/weather/README.md @@ -35,21 +35,21 @@ The following properties can be configured: | Option | Description | ---------------------------- | ----------- -| `weatherProvider` | Which weather provider should be used.

**Possible values:** `openweathermap` and `darksky`
**Default value:** `openweathermap` -| `type` | Which type of weather data should be displayed.

**Possible values:** `current` and `forecast`
**Default value:** `current` -| `units` | What units to use. Specified by config.js

**Possible values:** `config.units` = Specified by config.js, `default` = Kelvin, `metric` = Celsius, `imperial` =Fahrenheit
**Default value:** `config.units` +| `weatherProvider` | Which weather provider should be used.

**Possible values:** `openweathermap` , `darksky` , or `weathergov`
**Default value:** `openweathermap` +| `type` | Which type of weather data should be displayed.

**Possible values:** `current` or `forecast`
**Default value:** `current` +| `units` | What units to use. Specified by config.js

**Possible values:** `config.units` = Specified by config.js, `default` = Kelvin, `metric` = Celsius, `imperial` = Fahrenheit
**Default value:** `config.units` | `roundTemp` | Round temperature value to nearest integer.

**Possible values:** `true` (round to integer) or `false` (display exact value with decimal point)
**Default value:** `false` -| `degreeLabel` | Show the degree label for your chosen units (Metric = C, Imperial = F, Kelvins = K).

**Possible values:** `true` or `false`
**Default value:** `false` +| `degreeLabel` | Show the degree label for your chosen units (Metric = C, Imperial = F, Kelvin = K).

**Possible values:** `true` or `false`
**Default value:** `false` | `updateInterval` | How often does the content needs to be fetched? (Milliseconds)

**Possible values:** `1000` - `86400000`
**Default value:** `600000` (10 minutes) -| `animationSpeed` | Speed of the update animation. (Milliseconds)

**Possible values:**`0` - `5000`
**Default value:** `1000` (1 second) +| `animationSpeed` | Speed of the update animation. (Milliseconds)

**Possible values:** `0` - `5000`
**Default value:** `1000` (1 second) | `timeFormat` | Use 12 or 24 hour format.

**Possible values:** `12` or `24`
**Default value:** uses value of _config.timeFormat_ | `showPeriod` | Show the period (am/pm) with 12 hour format

**Possible values:** `true` or `false`
**Default value:** `true` | `showPeriodUpper` | Show the period (AM/PM) with 12 hour format as uppercase

**Possible values:** `true` or `false`
**Default value:** `false` | `lang` | The language of the days.

**Possible values:** `en`, `nl`, `ru`, etc ...
**Default value:** uses value of _config.language_ | `decimalSymbol` | The decimal symbol to use.

**Possible values:** `.`, `,` or any other symbol.
**Default value:** `.` -| `initialLoadDelay` | The initial delay before loading. If you have multiple modules that use the same API key, you might want to delay one of the requests. (Milliseconds)

**Possible values:** `1000` - `5000`
**Default value:** `0` -| `appendLocationNameToHeader` | If set to `true`, the returned location name will be appended to the header of the module, if the header is enabled. This is mainly intresting when using calender based weather.

**Default value:** `true` -| `calendarClass` | The class for the calender module to base the event based weather information on.

**Default value:** `'calendar'` +| `initialLoadDelay` | The initial delay before loading. If you have multiple modules that use the same API key, you might want to delay one of the requests. (Milliseconds)

**Possible values:** `1000` - `5000`
**Default value:** `0` +| `appendLocationNameToHeader` | If set to `true`, the returned location name will be appended to the header of the module, if the header is enabled. This is mainly interesting when using calender based weather.

**Default value:** `true` +| `calendarClass` | The class for the calender module to base the event based weather information on.

**Default value:** `'calendar'` #### Current weather options @@ -62,14 +62,14 @@ The following properties can be configured: | `showHumidity` | Show the current humidity

**Possible values:** `true` or `false`
**Default value:** `false` | `showIndoorTemperature` | If you have another module that emits the `INDOOR_TEMPERATURE` notification, the indoor temperature will be displayed
**Default value:** `false` | `showIndoorHumidity` | If you have another module that emits the `INDOOR_HUMIDITY` notification, the indoor humidity will be displayed
**Default value:** `false` -| `showFeelsLike` | Shows the Feels like temperature weather.

**Possible values:**`true` or `false`
**Default value:** `true` +| `showFeelsLike` | Shows the Feels like temperature weather.

**Possible values:** `true` or `false`
**Default value:** `true` #### Weather forecast options | Option | Description | ---------------------------- | ----------- -| `tableClass` | The class for the forecast table.

**Default value:** `'small'` -| `colored` | If set to `true`, the min and max temperature are color coded.

**Default value:** `false` +| `tableClass` | The class for the forecast table.

**Default value:** `'small'` +| `colored` | If set to `true`, the min and max temperature are color coded.

**Default value:** `false` | `showPrecipitationAmount` | Show the amount of rain/snow in the forecast

**Possible values:** `true` or `false`
**Default value:** `false` | `fade` | Fade the future events to black. (Gradient)

**Possible values:** `true` or `false`
**Default value:** `true` | `fadePoint` | Where to start fade?

**Possible values:** `0` (top of the list) - `1` (bottom of list)
**Default value:** `0.25` @@ -79,31 +79,31 @@ The following properties can be configured: | Option | Description | ---------------------------- | ----------- -| `apiVersion` | The OpenWeatherMap API version to use.

**Default value:** `2.5` -| `apiBase` | The OpenWeatherMap base URL.

**Default value:** `'http://api.openweathermap.org/data/'` -| `weatherEndpoint` | The OpenWeatherMap API endPoint.

**Possible values:** `/weather`, `/forecast` (free users) or `/forecast/daily` (paying users or old apiKey only)
**Default value:** `'/weather'` +| `apiVersion` | The OpenWeatherMap API version to use.

**Default value:** `2.5` +| `apiBase` | The OpenWeatherMap base URL.

**Default value:** `'http://api.openweathermap.org/data/'` +| `weatherEndpoint` | The OpenWeatherMap API endPoint.

**Possible values:** `/weather`, `/forecast` (free users) or `/forecast/daily` (paying users or old apiKey only)
**Default value:** `'/weather'` | `locationID` | Location ID from [OpenWeatherMap](https://openweathermap.org/find) **This will override anything you put in location.**
Leave blank if you want to use location.
**Example:** `1234567`
**Default value:** `false`

**Note:** When the `location` and `locationID` are both not set, the location will be based on the information provided by the calendar module. The first upcoming event with location data will be used. | `location` | The location used for weather information.

**Example:** `'Amsterdam,Netherlands'`
**Default value:** `false`

**Note:** When the `location` and `locationID` are both not set, the location will be based on the information provided by the calendar module. The first upcoming event with location data will be used. -| `apiKey` | The [OpenWeatherMap](https://home.openweathermap.org) API key, which can be obtained by creating an OpenWeatherMap account.

This value is **REQUIRED** +| `apiKey` | The [OpenWeatherMap](https://home.openweathermap.org) API key, which can be obtained by creating an OpenWeatherMap account.

This value is **REQUIRED** ### Darksky options | Option | Description | ---------------------------- | ----------- -| `apiBase` | The DarkSky base URL. The darksky api has disabled [cors](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), therefore a proxy is required.

**Possible value:** `'https://cors-anywhere.herokuapp.com/https://api.darksky.net'`
This value is **REQUIRED** -| `weatherEndpoint` | The DarkSky API endPoint.

**Possible values:** `/forecast`
This value is **REQUIRED** -| `apiKey` | The [DarkSky](https://darksky.net/dev/register) API key, which can be obtained by creating an DarkSky account.

This value is **REQUIRED** -| `lat` | The geo coordinate latitude.

This value is **REQUIRED** -| `lon` | The geo coordinate longitude.

This value is **REQUIRED** +| `apiBase` | The DarkSky base URL. The darksky api has disabled [cors](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), therefore a proxy is required.

**Possible value:** `'https://cors-anywhere.herokuapp.com/https://api.darksky.net'`
This value is **REQUIRED** +| `weatherEndpoint` | The DarkSky API endPoint.

**Possible values:** `/forecast`
This value is **REQUIRED** +| `apiKey` | The [DarkSky](https://darksky.net/dev/register) API key, which can be obtained by creating an DarkSky account.

This value is **REQUIRED** +| `lat` | The geo coordinate latitude.

This value is **REQUIRED** +| `lon` | The geo coordinate longitude.

This value is **REQUIRED** ### Weather.gov options | Option | Description | ---------------------------- | ----------- -| `apiBase` | The weather.gov base URL.

**Possible value:** `'https://api.weather.gov/points/'`
This value is **REQUIRED** -| `weatherEndpoint` | The weather.gov API endPoint.

**Possible values:** `/forecast` for forecast and `/forecast/hourly` for current.
This value is **REQUIRED** -| `lat` | The geo coordinate latitude.

This value is **REQUIRED** -| `lon` | The geo coordinate longitude.

This value is **REQUIRED** +| `apiBase` | The weather.gov base URL.

**Possible value:** `'https://api.weather.gov/points/'`
This value is **REQUIRED** +| `weatherEndpoint` | The weather.gov API endPoint.

**Possible values:** `/forecast` for forecast and `/forecast/hourly` for current.
This value is **REQUIRED** +| `lat` | The geo coordinate latitude.

This value is **REQUIRED** +| `lon` | The geo coordinate longitude.

This value is **REQUIRED** ## API Provider Development diff --git a/modules/default/weather/providers/README.md b/modules/default/weather/providers/README.md index 85d9c3c5..7acb7e34 100644 --- a/modules/default/weather/providers/README.md +++ b/modules/default/weather/providers/README.md @@ -85,7 +85,7 @@ Notify the delegate that new weather is available. #### `fetchData(url, method, data)` -A convinience function to make requests. It returns a promise. +A convenience function to make requests. It returns a promise. ### WeatherObject From 358e2b3ccf7f74238237947a09de54ec26f4373d Mon Sep 17 00:00:00 2001 From: Veeck Date: Fri, 8 Mar 2019 11:25:38 +0100 Subject: [PATCH 094/116] Use getHeader instead of data.header when creating the DOM --- js/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/main.js b/js/main.js index 21a882f8..41e90a96 100644 --- a/js/main.js +++ b/js/main.js @@ -39,12 +39,12 @@ var MM = (function() { dom.opacity = 0; wrapper.appendChild(dom); - if (typeof module.data.header !== "undefined" && module.data.header !== "") { + if (typeof module.getHeader() !== "undefined" && module.getHeader() !== "") { var moduleHeader = document.createElement("header"); - moduleHeader.innerHTML = module.data.header; + moduleHeader.innerHTML = module.getHeader(); moduleHeader.className = "module-header"; dom.appendChild(moduleHeader); - } + } var moduleContent = document.createElement("div"); moduleContent.className = "module-content"; From 5dfd8a61be37c152a9a2e97051485d85faf4a1c9 Mon Sep 17 00:00:00 2001 From: Veeck Date: Fri, 8 Mar 2019 11:29:48 +0100 Subject: [PATCH 095/116] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dad485a..b85367df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Fix null dereference in moduleNeedsUpdate when the module isn't visible - Calendar: Fixed event end times by setting default calendarEndTime to "LT" (Local time format). [#1479] - Calendar: Fixed missing calendar fetchers after server process restarts [#1589](https://github.com/MichMich/MagicMirror/issues/1589) +- Use getHeader instead of data.header when creating the DOM so overwriting the function also propagates into it ### New weather module - Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). From 29ef1db86b0278c5cb87e22b7439e835328a0831 Mon Sep 17 00:00:00 2001 From: Veeck Date: Fri, 8 Mar 2019 11:33:02 +0100 Subject: [PATCH 096/116] Remove whitespace --- js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index 41e90a96..2330d3ee 100644 --- a/js/main.js +++ b/js/main.js @@ -44,7 +44,7 @@ var MM = (function() { moduleHeader.innerHTML = module.getHeader(); moduleHeader.className = "module-header"; dom.appendChild(moduleHeader); - } + } var moduleContent = document.createElement("div"); moduleContent.className = "module-content"; From de684dcb63c7d3069213ac28c9339b53b136a325 Mon Sep 17 00:00:00 2001 From: Veeck Date: Fri, 8 Mar 2019 11:19:15 +0100 Subject: [PATCH 097/116] Fix typos in jsdoc --- js/module.js | 4 ++-- modules/default/calendar/calendarfetcher.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/module.js b/js/module.js index 907a7f61..3e39dd5c 100644 --- a/js/module.js +++ b/js/module.js @@ -212,7 +212,7 @@ var Module = Class.extend({ /* setData(data) * Set the module data. * - * argument data obejct - Module data. + * argument data object - Module data. */ setData: function (data) { this.data = data; @@ -226,7 +226,7 @@ var Module = Class.extend({ /* setConfig(config) * Set the module config and combine it with the module defaults. * - * argument config obejct - Module config. + * argument config object - Module config. */ setConfig: function (config) { this.config = Object.assign({}, this.defaults, config); diff --git a/modules/default/calendar/calendarfetcher.js b/modules/default/calendar/calendarfetcher.js index a1e4aa8d..0076a605 100644 --- a/modules/default/calendar/calendarfetcher.js +++ b/modules/default/calendar/calendarfetcher.js @@ -273,7 +273,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri /* isFullDayEvent(event) * Checks if an event is a fullday event. * - * argument event obejct - The event object to check. + * argument event object - The event object to check. * * return bool - The event is a fullday event. */ From c0ab2ac297cad7b612fa87903289755bf5ca9dc9 Mon Sep 17 00:00:00 2001 From: Chris van Marle Date: Wed, 13 Mar 2019 12:01:49 +0100 Subject: [PATCH 098/116] Support timer in notifications too --- CHANGELOG.md | 1 + modules/default/alert/README.md | 9 +++++---- modules/default/alert/alert.js | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dad485a..0cd2e5c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Added option to split multiple day events in calendar to separate numbered events - Slovakian translation - Alerts now can contain Font Awesome icons +- Notifications display time can be set in request ### Updated - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) diff --git a/modules/default/alert/README.md b/modules/default/alert/README.md index e193e4ba..4c6e4333 100644 --- a/modules/default/alert/README.md +++ b/modules/default/alert/README.md @@ -43,10 +43,11 @@ self.sendNotification("SHOW_ALERT", {}); ``` ### Notification params -| Option | Description -| --------- | ----------- -| `title` | The title of the notification.

**Possible values:** `text` or `html` -| `message` | The message of the notification.

**Possible values:** `text` or `html` +| Option | Description +| ------------------ | ----------- +| `title` | The title of the notification.

**Possible values:** `text` or `html` +| `message` | The message of the notification.

**Possible values:** `text` or `html` +| `timer` (optional) | How long the notification should stay visible in ms.
If absent, the default `display_time` is used.
**Possible values:** `int` `float` ### Alert params diff --git a/modules/default/alert/alert.js b/modules/default/alert/alert.js index 9c0d91a7..0f47bc3f 100644 --- a/modules/default/alert/alert.js +++ b/modules/default/alert/alert.js @@ -51,7 +51,7 @@ Module.register("alert",{ message: msg, layout: "growl", effect: this.config.effect, - ttl: this.config.display_time + ttl: message.timer !== undefined ? message.timer : this.config.display_time }).show(); }, show_alert: function(params, sender) { From 3880c8dc2c4bb4a8de748d005fd73f39736cf015 Mon Sep 17 00:00:00 2001 From: Chris van Marle Date: Wed, 13 Mar 2019 12:52:30 +0100 Subject: [PATCH 099/116] Restyle notification colors --- CHANGELOG.md | 1 + modules/default/alert/ns-default.css | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cd2e5c6..3af53301 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Fix null dereference in moduleNeedsUpdate when the module isn't visible - Calendar: Fixed event end times by setting default calendarEndTime to "LT" (Local time format). [#1479] - Calendar: Fixed missing calendar fetchers after server process restarts [#1589](https://github.com/MichMich/MagicMirror/issues/1589) +- Notification: fixed background color (was white text on white background) ### New weather module - Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). diff --git a/modules/default/alert/ns-default.css b/modules/default/alert/ns-default.css index db3ba3a3..73b8740d 100644 --- a/modules/default/alert/ns-default.css +++ b/modules/default/alert/ns-default.css @@ -1,7 +1,7 @@ /* Based on work by http://tympanus.net/codrops/licensing/ */ .ns-box { - background: #fff; + background-color: rgba(0, 0, 0, 0.93); padding: 17px; line-height: 1.4; margin-bottom: 10px; @@ -12,7 +12,10 @@ display: table; word-wrap: break-word; max-width: 100%; + border-width: 1px; border-radius: 5px; + border-style: solid; + border-color: #666; } .ns-alert { From 80eef2ab8c75e8fc7e9329b09d0e5391847693ba Mon Sep 17 00:00:00 2001 From: Daniel Burr Date: Mon, 18 Mar 2019 16:23:03 +0100 Subject: [PATCH 100/116] Fix documentation of `useKMPHwind` option in currentweather --- CHANGELOG.md | 1 + modules/default/currentweather/README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cee21d56..affb7f86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Ignore entries with unparseable details in the calendar module - Bug showing FullDayEvents one day too long in calendar fixed - Bug in newsfeed when `removeStartTags` is used on the description [#1478](https://github.com/MichMich/MagicMirror/issues/1478) +- Fix documentation of `useKMPHwind` option in currentweather ### Updated - The default calendar setting `showEnd` is changed to `false`. diff --git a/modules/default/currentweather/README.md b/modules/default/currentweather/README.md index ac883a93..ce8cd19e 100644 --- a/modules/default/currentweather/README.md +++ b/modules/default/currentweather/README.md @@ -50,7 +50,7 @@ The following properties can be configured: | `showIndoorTemperature` | If you have another module that emits the INDOOR_TEMPERATURE notification, the indoor temperature will be displayed
**Default value:** `false` | `onlyTemp` | Show only current Temperature and weather icon without windspeed, sunset, sunrise time and feels like.

**Possible values:** `true` or `false`
**Default value:** `false` | `showFeelsLike` | Shows the Feels like temperature weather.

**Possible values:**`true` or `false`
**Default value:** `true` -| `useKMPHWind` | Uses KMPH as units for windspeed.

**Possible values:**`true` or `false`
**Default value:** `false` +| `useKMPHwind` | Uses KMPH as units for windspeed.

**Possible values:**`true` or `false`
**Default value:** `false` | `useBeaufort` | Pick between using the Beaufort scale for wind speed or using the default units.

**Possible values:** `true` or `false`
**Default value:** `true` | `lang` | The language of the days.

**Possible values:** `en`, `nl`, `ru`, etc ...
**Default value:** uses value of _config.language_ | `decimalSymbol` | The decimal symbol to use.

**Possible values:** `.`, `,` or any other symbol.
**Default value:** `.` From e38dbee6a6f9b4325cb71f7076df01d006ab65ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kinen?= Date: Mon, 18 Mar 2019 22:23:10 +0200 Subject: [PATCH 101/116] Node 9 -> 10 (LTS) --- installers/raspberry.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installers/raspberry.sh b/installers/raspberry.sh index 4e9c20d8..38b067a9 100644 --- a/installers/raspberry.sh +++ b/installers/raspberry.sh @@ -82,7 +82,7 @@ if $NODE_INSTALL; then # The NODE_STABLE_BRANCH variable will need to be manually adjusted when a new branch is released. (e.g. 7.x) # Only tested (stable) versions are recommended as newer versions could break MagicMirror. - NODE_STABLE_BRANCH="9.x" + NODE_STABLE_BRANCH="10.x" curl -sL https://deb.nodesource.com/setup_$NODE_STABLE_BRANCH | sudo -E bash - sudo apt-get install -y nodejs echo -e "\e[92mNode.js installation Done!\e[0m" From 36abbfc0482923ee3dfe92bd190491bded490bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kinen?= Date: Mon, 18 Mar 2019 23:12:44 +0200 Subject: [PATCH 102/116] Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f295db5..7083b657 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) - Updated modernizr code in alert module, fixed a small typo there too - More verbose error message on console if the config is malformed +- Updated installer script to install Node.js version 10.x ### Fixed - Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503), [#1511](https://github.com/MichMich/MagicMirror/issues/1511). From 29c9c92ba658df2f58297bb76776caa509d02bba Mon Sep 17 00:00:00 2001 From: Daniel Burr Date: Mon, 25 Mar 2019 01:08:59 +0100 Subject: [PATCH 103/116] Add support for the ARTICLE_INFO_REQUEST notification Upon reception of an ARTICLE_INFO_REQUEST notification, newsfeed will respond with the notification ARTICLE_INFO_RESPONSE, containing the fields 'title', 'source', 'date', 'desc' and 'url'. --- modules/default/newsfeed/README.md | 1 + modules/default/newsfeed/newsfeed.js | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/default/newsfeed/README.md b/modules/default/newsfeed/README.md index c06c3f07..b14a7ac6 100644 --- a/modules/default/newsfeed/README.md +++ b/modules/default/newsfeed/README.md @@ -46,6 +46,7 @@ MagicMirror's [notification mechanism](https://github.com/MichMich/MagicMirror/t | `ARTICLE_MORE_DETAILS` | When received the _first time_, shows the corresponding description of the currently displayed news title.
The module expects that the module's configuration option `showDescription` is set to `false` (default value).

When received a _second consecutive time_, shows the full news article in an IFRAME.
This requires that the news page can be embedded in an IFRAME, e.g. doesn't have the HTTP response header [X-Frame-Options](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options) set to e.g. `DENY`.

When received the _next consecutive times_, reloads the page and scrolls down by `scrollLength` pixels to paginate through the article. | `ARTICLE_LESS_DETAILS` | Hides the summary or full news article and only displays the news title of the currently viewed news item. | `ARTICLE_TOGGLE_FULL` | Toogles article in fullscreen. +| `ARTICLE_INFO_REQUEST` | Causes `newsfeed` to respond with the notification `ARTICLE_INFO_RESPONSE`, the payload of which provides the `title`, `source`, `date`, `desc` and `url` of the current news title. Note the payload of the sent notification event is ignored. diff --git a/modules/default/newsfeed/newsfeed.js b/modules/default/newsfeed/newsfeed.js index 212a6a0f..3bb38d0a 100644 --- a/modules/default/newsfeed/newsfeed.js +++ b/modules/default/newsfeed/newsfeed.js @@ -189,7 +189,7 @@ Module.register("newsfeed",{ fullArticle.style.top = "0"; fullArticle.style.left = "0"; fullArticle.style.border = "none"; - fullArticle.src = typeof this.newsItems[this.activeItem].url === "string" ? this.newsItems[this.activeItem].url : this.newsItems[this.activeItem].url.href; + fullArticle.src = this.getActiveItemURL() fullArticle.style.zIndex = 1; wrapper.appendChild(fullArticle); } @@ -210,6 +210,10 @@ Module.register("newsfeed",{ return wrapper; }, + getActiveItemURL: function() { + return typeof this.newsItems[this.activeItem].url === "string" ? this.newsItems[this.activeItem].url : this.newsItems[this.activeItem].url.href; + }, + /* registerFeeds() * registers the feeds to be used by the backend. */ @@ -387,6 +391,14 @@ Module.register("newsfeed",{ } else { this.showFullArticle(); } + } else if (notification === "ARTICLE_INFO_REQUEST"){ + this.sendNotification("ARTICLE_INFO_RESPONSE", { + title: this.newsItems[this.activeItem].title, + source: this.newsItems[this.activeItem].sourceTitle, + date: this.newsItems[this.activeItem].pubdate, + desc: this.newsItems[this.activeItem].description, + url: this.getActiveItemURL() + }) } else { Log.info(this.name + " - unknown notification, ignoring: " + notification); } From 07a5092eb3db06526a12330b4f377e2809b51e20 Mon Sep 17 00:00:00 2001 From: Daniel Burr Date: Mon, 25 Mar 2019 01:13:02 +0100 Subject: [PATCH 104/116] Add note to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2509c76e..fb8a8c68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Slovakian translation - Alerts now can contain Font Awesome icons - Notifications display time can be set in request +- newsfeed: added support for `ARTICLE_INFO_REQUEST` notification ### Updated - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) From 8f751812a6b0636238f837b68b60cf8f249b16a4 Mon Sep 17 00:00:00 2001 From: Daniel Burr Date: Mon, 25 Mar 2019 01:19:00 +0100 Subject: [PATCH 105/116] The note which I added to the changelog in commit 80eef2ab8c75e8fc7e9329b09d0e5391847693ba was in the 2.6.0 section instead of 2.7.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2509c76e..5a30ef18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Calendar: Fixed missing calendar fetchers after server process restarts [#1589](https://github.com/MichMich/MagicMirror/issues/1589) - Notification: fixed background color (was white text on white background) - Use getHeader instead of data.header when creating the DOM so overwriting the function also propagates into it +- Fix documentation of `useKMPHwind` option in currentweather ### New weather module - Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). @@ -85,7 +86,6 @@ A huge, huge, huge thanks to user @fewieden for all his hard work on the new `we - Ignore entries with unparseable details in the calendar module - Bug showing FullDayEvents one day too long in calendar fixed - Bug in newsfeed when `removeStartTags` is used on the description [#1478](https://github.com/MichMich/MagicMirror/issues/1478) -- Fix documentation of `useKMPHwind` option in currentweather ### Updated - The default calendar setting `showEnd` is changed to `false`. From f12860c7b1317b409d5b408636cd7cba640e81a9 Mon Sep 17 00:00:00 2001 From: Gary Krause Date: Mon, 25 Mar 2019 14:07:53 -0400 Subject: [PATCH 106/116] Spelling correction in README.md small spelling correction. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3d39832c..b8d8638b 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ The following wiki links are helpful for the initial configuration of your Magic **Note:** If you used the installer script. This step is already done for you. 2. Modify your required settings. \ - Note: You'll can check your configuration running `npm run config:check` in `/home/pi/MagicMirror`. + Note: You can check your configuration running `npm run config:check` in `/home/pi/MagicMirror`. The following properties can be configured: From 868b5e46173d425a1cdd7a3eaa626dbbad881948 Mon Sep 17 00:00:00 2001 From: Jon Kolb Date: Tue, 26 Mar 2019 09:02:19 -0400 Subject: [PATCH 107/116] Add name property to calendars When consuming CALENDAR_EVENTS broadcasts, it is useful for other modules to be able to identify which calendar a specific event came from, for filtering/display purposes. --- CHANGELOG.md | 1 + modules/default/calendar/README.md | 1 + modules/default/calendar/calendar.js | 12 ++++++++++++ 3 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2509c76e..4b035ecb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Slovakian translation - Alerts now can contain Font Awesome icons - Notifications display time can be set in request +- Add `name` config option for calendars to be sent along with event broadcasts ### Updated - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index 72aedd74..b2bb5c7f 100755 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -90,6 +90,7 @@ config: { | `repeatingCountTitle` | The count title for yearly repating events in this calendar.

**Example:** `'Birthday'` | `maximumEntries` | The maximum number of events shown. Overrides global setting. **Possible values:** `0` - `100` | `maximumNumberOfDays` | The maximum number of days in the future. Overrides global setting +| `name` | The name of the calendar. Included in event broadcasts as `calendarName`. | `auth` | The object containing options for authentication against the calendar. | `symbolClass` | Add a class to the cell of symbol. | `titleClass` | Add a class to the title's cell. diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index a6eeb226..d584a9ed 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -569,6 +569,17 @@ Module.register("calendar", { return this.getCalendarProperty(url, "timeClass", ""); }, + /* calendarNameForUrl(url) + * Retrieves the calendar name for a specific url. + * + * argument url string - Url to look for. + * + * return string - The name of the calendar + */ + calendarNameForUrl: function (url) { + return this.getCalendarProperty(url, "name", ""); + }, + /* colorForUrl(url) * Retrieves the color for a specific url. * @@ -709,6 +720,7 @@ Module.register("calendar", { for (var e in calendar) { var event = cloneObject(calendar[e]); event.symbol = this.symbolsForUrl(url); + event.calendarName = this.calendarNameForUrl(url); event.color = this.colorForUrl(url); delete event.url; eventList.push(event); From ef570558cf05bfd34c844c46c4ab0804da26aea6 Mon Sep 17 00:00:00 2001 From: Jasper Michalke Date: Thu, 28 Mar 2019 14:53:28 +0100 Subject: [PATCH 108/116] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2509c76e..3d15a68a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added - Italian translation for "Feels" +- Basic Klingon (tlhIngan Hol) translations - Disabled the screensaver on raspbian with installation script - Added option to truncate the number of vertical lines a calendar item can span if `wrapEvents` is enabled. - Danish translation for "Feels" and "Weeks" From d9601de07563127594c48465ea80c7f3beee48ed Mon Sep 17 00:00:00 2001 From: Jasper Michalke Date: Thu, 28 Mar 2019 14:55:01 +0100 Subject: [PATCH 109/116] Update translations.js Added Klingon translations file to translations list --- translations/translations.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/translations/translations.js b/translations/translations.js index 39bf8d5b..3d719cc3 100644 --- a/translations/translations.js +++ b/translations/translations.js @@ -39,7 +39,8 @@ var translations = { "bg" : "translations/bg.json", // Bulgarian "cs" : "translations/cs.json", // Czech "hr" : "translations/hr.json", // Croatian - "sk" : "translations/sk.json" // Slovak + "sk" : "translations/sk.json", // Slovak + "tlh" : "translations/tlh.json" // Klingon }; if (typeof module !== "undefined") {module.exports = translations;} From d7a7002bdd02bd408797fcfb140d6db9d3e60195 Mon Sep 17 00:00:00 2001 From: Jasper Michalke Date: Thu, 28 Mar 2019 14:57:45 +0100 Subject: [PATCH 110/116] Finally added all required files for Klingon translations --- translations/tlh.json | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 translations/tlh.json diff --git a/translations/tlh.json b/translations/tlh.json new file mode 100644 index 00000000..c13f4019 --- /dev/null +++ b/translations/tlh.json @@ -0,0 +1,35 @@ +{ + "LOADING": "loS …", + + "TODAY": "DaHjaj", + "TOMORROW": "wa'leS", + "DAYAFTERTOMORROW": "cha'leS", + "RUNNING": "Dor", + "EMPTY": "Sumbe' wanI'.", + + "WEEK": "Hogh (terran) {weekNumber}", + + "N": "N", + "NNE": "NNE", + "NE": "NE", + "ENE": "ENE", + "E": "chan", + "ESE": "ESE", + "SE": "SE", + "SSE": "SSE", + "S": "S", + "SSW": "SSW", + "SW": "tIng", + "WSW": "WSW", + "W": "W", + "WNW": "WNW", + "NW": "'ev", + "NNW": "NNW", + + "UPDATE_NOTIFICATION": " De'chu' MagicMirror² lI'laH.", + "UPDATE_NOTIFICATION_MODULE": "bobcho' {MODULE_NAME} lI'laH De'chu.", + "UPDATE_INFO_SINGLE": "The current installation is {COMMIT_COUNT} commit behind on the {BRANCH_NAME} branch.", + "UPDATE_INFO_MULTIPLE": "The current installation is {COMMIT_COUNT} commits behind on the {BRANCH_NAME} branch.", + + "FEELS": "jem" +} From 979041ee91e0690f0dfacb7000a1ab02413c427d Mon Sep 17 00:00:00 2001 From: Chris van Marle Date: Fri, 29 Mar 2019 13:13:56 +0100 Subject: [PATCH 111/116] Fix typo in variable name fetchedLocationName --- modules/default/currentweather/currentweather.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 2a6d24b9..8bca45be 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -71,7 +71,7 @@ Module.register("currentweather",{ firstEvent: false, // create a variable to hold the location name based on the API result. - fetchedLocatioName: "", + fetchedLocationName: "", // Define required scripts. getScripts: function() { @@ -266,7 +266,7 @@ Module.register("currentweather",{ // Override getHeader method. getHeader: function() { if (this.config.appendLocationNameToHeader) { - return this.data.header + " " + this.fetchedLocatioName; + return this.data.header + " " + this.fetchedLocationName; } return this.data.header; From 416ace4c863a06ce31803490d71bea124b7ec343 Mon Sep 17 00:00:00 2001 From: Chris van Marle Date: Fri, 29 Mar 2019 13:15:58 +0100 Subject: [PATCH 112/116] Update current weather header only if not undefined --- modules/default/currentweather/currentweather.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 8bca45be..2ccc23b7 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -265,7 +265,7 @@ Module.register("currentweather",{ // Override getHeader method. getHeader: function() { - if (this.config.appendLocationNameToHeader) { + if (this.config.appendLocationNameToHeader && this.data.header !== undefined) { return this.data.header + " " + this.fetchedLocationName; } From b0d97dd1708c68d58e63f6e9015b743f89db06d6 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Mon, 1 Apr 2019 20:47:07 +0200 Subject: [PATCH 113/116] Prepare for release. --- CHANGELOG.md | 8 ++--- package-lock.json | 30 ++++++++--------- package.json | 2 +- vendor/package-lock.json | 71 +++++++++++++++++++++++++++------------- 4 files changed, 68 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5ff969a..043bf6b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,16 +5,16 @@ This project adheres to [Semantic Versioning](http://semver.org/). --- -## [2.7.0] - Unreleased - -*This release is scheduled to be released on 2019-04-01.* +## [2.7.0] - 2019-04-01 ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. If you are having issues running Electron, make sure your [Raspbian is up to date](https://www.raspberrypi.org/documentation/raspbian/updating.md). +❤️ **Donate:** Enjoying MagicMirror²? Please consider a donation! With your help we can continue improving the MagicMirror² core: https://magicmirror.builders/donate + ### Added - Italian translation for "Feels" - Basic Klingon (tlhIngan Hol) translations -- Disabled the screensaver on raspbian with installation script +- Disabled the screensaver on raspbian with installation script - Added option to truncate the number of vertical lines a calendar item can span if `wrapEvents` is enabled. - Danish translation for "Feels" and "Weeks" - Added option to split multiple day events in calendar to separate numbered events diff --git a/package-lock.json b/package-lock.json index 124aa864..611c101c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.7.0-develop", + "version": "2.7.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1368,7 +1368,7 @@ "require-from-string": "^2.0.1", "rfc6902": "^2.2.2", "supports-hyperlinks": "^1.0.1", - "vm2": "github:patriksimek/vm2#7e82f90ac705fc44fad044147cb0df09b4c79a57", + "vm2": "github:patriksimek/vm2#custom_files", "voca": "^1.4.0" }, "dependencies": { @@ -1427,6 +1427,11 @@ "requires": { "has-flag": "^2.0.0" } + }, + "vm2": { + "version": "github:patriksimek/vm2#468bc1e54e75e766b842830ea775669992a979e0", + "from": "github:patriksimek/vm2#custom_files", + "dev": true } } }, @@ -2247,7 +2252,7 @@ }, "eventemitter2": { "version": "0.4.14", - "resolved": "http://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", "integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=", "dev": true }, @@ -2593,7 +2598,7 @@ }, "findup-sync": { "version": "0.3.0", - "resolved": "http://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", "dev": true, "requires": { @@ -2906,7 +2911,7 @@ }, "grunt-cli": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz", "integrity": "sha1-VisRnrsGndtGSs4oRVAb6Xs1tqg=", "dev": true, "requires": { @@ -4667,9 +4672,9 @@ } }, "moment": { - "version": "2.23.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.23.0.tgz", - "integrity": "sha512-3IE39bHVqFbWWaPOMHZF98Q9c3LDKGTmypMiTM2QygGXXElkFWIH7GxfmlwmY2vwa+wmNsoYZmG2iusf1ZjJoA==" + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", + "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" }, "ms": { "version": "2.0.0", @@ -5813,7 +5818,7 @@ }, "require-uncached": { "version": "1.0.3", - "resolved": "http://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", "dev": true, "requires": { @@ -5823,7 +5828,7 @@ }, "resolve": { "version": "1.1.7", - "resolved": "http://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", "dev": true }, @@ -7219,11 +7224,6 @@ "unist-util-stringify-position": "^1.1.1" } }, - "vm2": { - "version": "github:patriksimek/vm2#7e82f90ac705fc44fad044147cb0df09b4c79a57", - "from": "vm2@github:patriksimek/vm2#7e82f90ac705fc44fad044147cb0df09b4c79a57", - "dev": true - }, "voca": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/voca/-/voca-1.4.0.tgz", diff --git a/package.json b/package.json index 3180f70d..388b9ef8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.7.0-develop", + "version": "2.7.0", "description": "The open source modular smart mirror platform.", "main": "js/electron.js", "scripts": { diff --git a/vendor/package-lock.json b/vendor/package-lock.json index 9ad15ee5..3ce96fc2 100644 --- a/vendor/package-lock.json +++ b/vendor/package-lock.json @@ -193,11 +193,6 @@ "repeat-string": "^1.5.2" } }, - "font-awesome": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/font-awesome/-/font-awesome-4.7.0.tgz", - "integrity": "sha1-j6jPBBGhoxr9B7BtKQK7n8gVoTM=" - }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -230,7 +225,8 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true + "bundled": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -248,11 +244,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -265,15 +263,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -376,7 +377,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -386,6 +388,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -398,17 +401,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -425,6 +431,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -497,7 +504,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -507,6 +515,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -582,7 +591,8 @@ }, "safe-buffer": { "version": "5.1.1", - "bundled": true + "bundled": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -612,6 +622,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -629,6 +640,7 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -667,11 +679,13 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true + "bundled": true, + "optional": true }, "yallist": { "version": "3.0.2", - "bundled": true + "bundled": true, + "optional": true } } }, @@ -689,6 +703,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "optional": true, "requires": { "is-glob": "^2.0.0" } @@ -702,7 +717,8 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "optional": true }, "invert-kv": { "version": "1.0.0", @@ -721,7 +737,8 @@ "is-buffer": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", - "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=" + "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=", + "optional": true }, "is-dotfile": { "version": "1.0.3", @@ -747,7 +764,8 @@ "is-extglob": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", @@ -761,6 +779,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "optional": true, "requires": { "is-extglob": "^1.0.0" } @@ -789,7 +808,8 @@ "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "optional": true }, "isobject": { "version": "2.1.0", @@ -804,6 +824,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "optional": true, "requires": { "is-buffer": "^1.1.5" } @@ -869,6 +890,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "optional": true, "requires": { "remove-trailing-separator": "^1.0.1" } @@ -1017,12 +1039,14 @@ "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "optional": true }, "repeat-element": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=" + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "optional": true }, "repeat-string": { "version": "1.6.1", @@ -1033,7 +1057,8 @@ "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "optional": true }, "set-immediate-shim": { "version": "1.0.1", From 34e188ec1f0cd9a4626727bfeac336ebb7c7e3eb Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Mon, 1 Apr 2019 20:48:30 +0200 Subject: [PATCH 114/116] Typo. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 043bf6b8..1d68db99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. If you are having issues running Electron, make sure your [Raspbian is up to date](https://www.raspberrypi.org/documentation/raspbian/updating.md). -❤️ **Donate:** Enjoying MagicMirror²? Please consider a donation! With your help we can continue improving the MagicMirror² core: https://magicmirror.builders/donate +❤️ **Donate:** Enjoying MagicMirror²? Please consider a donation! With your help we can continue to improve the MagicMirror² core: https://magicmirror.builders/donate ### Added - Italian translation for "Feels" From ba705f556351a7f7f902e8d98c9872da8c8aa789 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Mon, 1 Apr 2019 20:55:24 +0200 Subject: [PATCH 115/116] Fix Lint Issue. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d68db99..04acfd5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. If you are having issues running Electron, make sure your [Raspbian is up to date](https://www.raspberrypi.org/documentation/raspbian/updating.md). -❤️ **Donate:** Enjoying MagicMirror²? Please consider a donation! With your help we can continue to improve the MagicMirror² core: https://magicmirror.builders/donate +❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/donate) With your help we can continue to improve the MagicMirror² core. ### Added - Italian translation for "Feels" From 43ba13f3bcc529f779bd64397e6dfc9ca28ec0a7 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Mon, 1 Apr 2019 21:26:39 +0200 Subject: [PATCH 116/116] Prepare 2.8.0-develop. --- CHANGELOG.md | 14 ++++++++++++-- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04acfd5f..4c4160af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,12 +5,22 @@ This project adheres to [Semantic Versioning](http://semver.org/). --- +❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/donate) With your help we can continue to improve the MagicMirror² core. + +## [2.8.0] - Unreleased + +*This release is scheduled to be released on 2019-04-01.* + +### Added + +### Updated + +### Fixed + ## [2.7.0] - 2019-04-01 ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. If you are having issues running Electron, make sure your [Raspbian is up to date](https://www.raspberrypi.org/documentation/raspbian/updating.md). -❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/donate) With your help we can continue to improve the MagicMirror² core. - ### Added - Italian translation for "Feels" - Basic Klingon (tlhIngan Hol) translations diff --git a/package-lock.json b/package-lock.json index 611c101c..d87793e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.7.0", + "version": "2.8.0-develop", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 388b9ef8..37fc0a69 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.7.0", + "version": "2.8.0-develop", "description": "The open source modular smart mirror platform.", "main": "js/electron.js", "scripts": {