mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Merge branch 'develop' into contribute
This commit is contained in:
commit
e0a9c7d0bb
@ -11,6 +11,10 @@ _This release is scheduled to be released on 2021-04-01._
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
- Added French translations for "MODULE_CONFIG_ERROR" and "PRECIP".
|
||||||
|
- Added German translation for "PRECIP".
|
||||||
|
- Added first test for Alert module.
|
||||||
|
- Added support for `dateFormat` when not using `timeFormat: "absolute"`
|
||||||
- Added `custom.css.sample` file for improved styling experience
|
- Added `custom.css.sample` file for improved styling experience
|
||||||
|
|
||||||
### Updated
|
### Updated
|
||||||
@ -24,6 +28,11 @@ _This release is scheduled to be released on 2021-04-01._
|
|||||||
|
|
||||||
- Fix calendar start function logging inconsistency.
|
- Fix calendar start function logging inconsistency.
|
||||||
- Fix updatenotification start function logging inconsistency.
|
- Fix updatenotification start function logging inconsistency.
|
||||||
|
- Checks and applies the showDescription setting for the newsfeed module again
|
||||||
|
- Fix tests in weather module and add one for decimalPoint in forecast
|
||||||
|
- Fix decimalSymbol in the forcast part of the new weather module #2530
|
||||||
|
- Fix wrong treatment of `appendLocationNameToHeader` when using `ukmetofficedatahub`
|
||||||
|
- Fix alert not recognizing multiple alerts (#2522)
|
||||||
|
|
||||||
## [2.15.0] - 2021-04-01
|
## [2.15.0] - 2021-04-01
|
||||||
|
|
||||||
|
16
fonts/package-lock.json
generated
16
fonts/package-lock.json
generated
@ -1,7 +1,21 @@
|
|||||||
{
|
{
|
||||||
"name": "magicmirror-fonts",
|
"name": "magicmirror-fonts",
|
||||||
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"lockfileVersion": 1,
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "magicmirror-fonts",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"roboto-fontface": "^0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/roboto-fontface": {
|
||||||
|
"version": "0.10.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/roboto-fontface/-/roboto-fontface-0.10.0.tgz",
|
||||||
|
"integrity": "sha512-OlwfYEgA2RdboZohpldlvJ1xngOins5d7ejqnIBWr9KaMxsnBqotpptRXTyfNRLnFpqzX6sTDt+X+a+6udnU8g=="
|
||||||
|
}
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"roboto-fontface": {
|
"roboto-fontface": {
|
||||||
"version": "0.10.0",
|
"version": "0.10.0",
|
||||||
|
@ -79,7 +79,7 @@ Module.register("alert", {
|
|||||||
|
|
||||||
//If module already has an open alert close it
|
//If module already has an open alert close it
|
||||||
if (this.alerts[sender.name]) {
|
if (this.alerts[sender.name]) {
|
||||||
this.hide_alert(sender);
|
this.hide_alert(sender, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Display title and message only if they are provided in notification parameters
|
//Display title and message only if they are provided in notification parameters
|
||||||
@ -114,10 +114,10 @@ Module.register("alert", {
|
|||||||
}, params.timer);
|
}, params.timer);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hide_alert: function (sender) {
|
hide_alert: function (sender, close = true) {
|
||||||
//Dismiss alert and remove from this.alerts
|
//Dismiss alert and remove from this.alerts
|
||||||
if (this.alerts[sender.name]) {
|
if (this.alerts[sender.name]) {
|
||||||
this.alerts[sender.name].dismiss();
|
this.alerts[sender.name].dismiss(close);
|
||||||
this.alerts[sender.name] = null;
|
this.alerts[sender.name] = null;
|
||||||
//Remove overlay
|
//Remove overlay
|
||||||
const overlay = document.getElementById("overlay");
|
const overlay = document.getElementById("overlay");
|
||||||
|
@ -123,7 +123,7 @@
|
|||||||
/**
|
/**
|
||||||
* Dismiss the notification
|
* Dismiss the notification
|
||||||
*/
|
*/
|
||||||
NotificationFx.prototype.dismiss = function () {
|
NotificationFx.prototype.dismiss = function (close = true) {
|
||||||
this.active = false;
|
this.active = false;
|
||||||
clearTimeout(this.dismissttl);
|
clearTimeout(this.dismissttl);
|
||||||
this.ntf.classList.remove("ns-show");
|
this.ntf.classList.remove("ns-show");
|
||||||
@ -131,7 +131,7 @@
|
|||||||
this.ntf.classList.add("ns-hide");
|
this.ntf.classList.add("ns-hide");
|
||||||
|
|
||||||
// callback
|
// callback
|
||||||
this.options.onClose();
|
if (close) this.options.onClose();
|
||||||
}, 25);
|
}, 25);
|
||||||
|
|
||||||
// after animation ends remove ntf from the DOM
|
// after animation ends remove ntf from the DOM
|
||||||
|
@ -366,13 +366,14 @@ Module.register("calendar", {
|
|||||||
if (event.startDate >= now) {
|
if (event.startDate >= now) {
|
||||||
// Use relative time
|
// Use relative time
|
||||||
if (!this.config.hideTime) {
|
if (!this.config.hideTime) {
|
||||||
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").calendar());
|
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").calendar(null, { sameElse: this.config.dateFormat }));
|
||||||
} else {
|
} else {
|
||||||
timeWrapper.innerHTML = this.capFirst(
|
timeWrapper.innerHTML = this.capFirst(
|
||||||
moment(event.startDate, "x").calendar(null, {
|
moment(event.startDate, "x").calendar(null, {
|
||||||
sameDay: "[" + this.translate("TODAY") + "]",
|
sameDay: "[" + this.translate("TODAY") + "]",
|
||||||
nextDay: "[" + this.translate("TOMORROW") + "]",
|
nextDay: "[" + this.translate("TOMORROW") + "]",
|
||||||
nextWeek: "dddd"
|
nextWeek: "dddd",
|
||||||
|
sameElse: this.config.dateFormat
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
<div class="newsfeed-title bright medium light{{ ' no-wrap' if not config.wrapTitle }}">
|
<div class="newsfeed-title bright medium light{{ ' no-wrap' if not config.wrapTitle }}">
|
||||||
{{ title }}
|
{{ title }}
|
||||||
</div>
|
</div>
|
||||||
|
{% if config.showDescription %}
|
||||||
<div class="newsfeed-desc small light{{ ' no-wrap' if not config.wrapDescription }}">
|
<div class="newsfeed-desc small light{{ ' no-wrap' if not config.wrapDescription }}">
|
||||||
{% if config.truncDescription %}
|
{% if config.truncDescription %}
|
||||||
{{ description | truncate(config.lengthDescription) }}
|
{{ description | truncate(config.lengthDescription) }}
|
||||||
@ -20,6 +21,7 @@
|
|||||||
{{ description }}
|
{{ description }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% elseif error %}
|
{% elseif error %}
|
||||||
<div class="small dimmed">
|
<div class="small dimmed">
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<td class="bright weather-icon"><span class="wi weathericon wi-{{ f.weatherType }}"></span></td>
|
<td class="bright weather-icon"><span class="wi weathericon wi-{{ f.weatherType }}"></span></td>
|
||||||
<td class="align-right bright max-temp">
|
<td class="align-right bright max-temp">
|
||||||
{{ f.maxTemperature | roundValue | unit("temperature") }}
|
{{ f.maxTemperature | roundValue | unit("temperature") | decimalSymbol }}
|
||||||
</td>
|
</td>
|
||||||
<td class="align-right min-temp">
|
<td class="align-right min-temp">
|
||||||
{{ f.minTemperature | roundValue | unit("temperature") }}
|
{{ f.minTemperature | roundValue | unit("temperature") | decimalSymbol }}
|
||||||
</td>
|
</td>
|
||||||
{% if config.showPrecipitationAmount %}
|
{% if config.showPrecipitationAmount %}
|
||||||
<td class="align-right bright precipitation">
|
<td class="align-right bright precipitation">
|
||||||
|
@ -59,9 +59,7 @@ WeatherProvider.register("ukmetofficedatahub", {
|
|||||||
let queryStrings = "?";
|
let queryStrings = "?";
|
||||||
queryStrings += "latitude=" + this.config.lat;
|
queryStrings += "latitude=" + this.config.lat;
|
||||||
queryStrings += "&longitude=" + this.config.lon;
|
queryStrings += "&longitude=" + this.config.lon;
|
||||||
if (this.config.appendLocationNameToHeader) {
|
|
||||||
queryStrings += "&includeLocationName=" + true;
|
queryStrings += "&includeLocationName=" + true;
|
||||||
}
|
|
||||||
|
|
||||||
// Return URL, making sure there is a trailing "/" in the base URL.
|
// Return URL, making sure there is a trailing "/" in the base URL.
|
||||||
return this.config.apiBase + (this.config.apiBase.endsWith("/") ? "" : "/") + forecastType + queryStrings;
|
return this.config.apiBase + (this.config.apiBase.endsWith("/") ? "" : "/") + forecastType + queryStrings;
|
||||||
|
9035
package-lock.json
generated
9035
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@ -50,7 +50,7 @@
|
|||||||
"eslint-plugin-prettier": "^3.3.1",
|
"eslint-plugin-prettier": "^3.3.1",
|
||||||
"express-basic-auth": "^1.2.0",
|
"express-basic-auth": "^1.2.0",
|
||||||
"husky": "^4.3.8",
|
"husky": "^4.3.8",
|
||||||
"jsdom": "^16.5.1",
|
"jsdom": "^16.5.2",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mocha": "^8.3.2",
|
"mocha": "^8.3.2",
|
||||||
"mocha-each": "^2.0.1",
|
"mocha-each": "^2.0.1",
|
||||||
@ -70,11 +70,11 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"colors": "^1.4.0",
|
"colors": "^1.4.0",
|
||||||
"console-stamp": "^3.0.0-rc4.2",
|
"console-stamp": "^3.0.2",
|
||||||
"digest-fetch": "^1.1.6",
|
"digest-fetch": "^1.1.6",
|
||||||
"eslint": "^7.23.0",
|
"eslint": "^7.24.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"express-ipfilter": "^1.1.2",
|
"express-ipfilter": "^1.2.0",
|
||||||
"feedme": "^2.0.2",
|
"feedme": "^2.0.2",
|
||||||
"helmet": "^4.4.1",
|
"helmet": "^4.4.1",
|
||||||
"iconv-lite": "^0.6.2",
|
"iconv-lite": "^0.6.2",
|
||||||
@ -85,8 +85,7 @@
|
|||||||
"rrule": "^2.6.8",
|
"rrule": "^2.6.8",
|
||||||
"rrule-alt": "^2.2.8",
|
"rrule-alt": "^2.2.8",
|
||||||
"simple-git": "^2.37.0",
|
"simple-git": "^2.37.0",
|
||||||
"socket.io": "^4.0.0",
|
"socket.io": "^4.0.1"
|
||||||
"valid-url": "^1.0.9"
|
|
||||||
},
|
},
|
||||||
"_moduleAliases": {
|
"_moduleAliases": {
|
||||||
"node_helper": "js/node_helper.js",
|
"node_helper": "js/node_helper.js",
|
||||||
|
34
tests/configs/modules/alert/default.js
Normal file
34
tests/configs/modules/alert/default.js
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/* Magic Mirror Test config sample module alert
|
||||||
|
*
|
||||||
|
* By rejas
|
||||||
|
* MIT Licensed.
|
||||||
|
*/
|
||||||
|
let config = {
|
||||||
|
port: 8080,
|
||||||
|
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
|
||||||
|
|
||||||
|
language: "en",
|
||||||
|
timeFormat: 24,
|
||||||
|
units: "metric",
|
||||||
|
electronOptions: {
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true,
|
||||||
|
enableRemoteModule: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
modules: [
|
||||||
|
{
|
||||||
|
module: "alert",
|
||||||
|
config: {
|
||||||
|
display_time: 1000000,
|
||||||
|
welcome_message: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||||
|
if (typeof module !== "undefined") {
|
||||||
|
module.exports = config;
|
||||||
|
}
|
@ -27,7 +27,8 @@ let config = {
|
|||||||
url: "http://localhost:8080/tests/configs/data/feed_test_rodrigoramirez.xml"
|
url: "http://localhost:8080/tests/configs/data/feed_test_rodrigoramirez.xml"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
prohibitedWords: ["QPanel"]
|
prohibitedWords: ["QPanel"],
|
||||||
|
showDescription: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
39
tests/configs/modules/weather/forecastweather_units.js
Normal file
39
tests/configs/modules/weather/forecastweather_units.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
/* Magic Mirror Test config default weather
|
||||||
|
*
|
||||||
|
* By rejas
|
||||||
|
* MIT Licensed.
|
||||||
|
*/
|
||||||
|
let config = {
|
||||||
|
port: 8080,
|
||||||
|
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
|
||||||
|
|
||||||
|
language: "en",
|
||||||
|
timeFormat: 24,
|
||||||
|
units: "imperial",
|
||||||
|
electronOptions: {
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true,
|
||||||
|
enableRemoteModule: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
modules: [
|
||||||
|
{
|
||||||
|
module: "weather",
|
||||||
|
position: "bottom_bar",
|
||||||
|
config: {
|
||||||
|
type: "forecast",
|
||||||
|
location: "Munich",
|
||||||
|
apiKey: "fake key",
|
||||||
|
weatherEndpoint: "/forecast/daily",
|
||||||
|
initialLoadDelay: 3000,
|
||||||
|
decimalSymbol: "_"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||||
|
if (typeof module !== "undefined") {
|
||||||
|
module.exports = config;
|
||||||
|
}
|
37
tests/e2e/modules/alert_spec.js
Normal file
37
tests/e2e/modules/alert_spec.js
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
const helpers = require("../global-setup");
|
||||||
|
|
||||||
|
const describe = global.describe;
|
||||||
|
const it = global.it;
|
||||||
|
const beforeEach = global.beforeEach;
|
||||||
|
const afterEach = global.afterEach;
|
||||||
|
|
||||||
|
describe("Alert module", function () {
|
||||||
|
helpers.setupTimeout(this);
|
||||||
|
|
||||||
|
let app = null;
|
||||||
|
|
||||||
|
beforeEach(function () {
|
||||||
|
return helpers
|
||||||
|
.startApplication({
|
||||||
|
args: ["js/electron.js"]
|
||||||
|
})
|
||||||
|
.then(function (startedApp) {
|
||||||
|
app = startedApp;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(function () {
|
||||||
|
return helpers.stopApplication(app);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("Default configuration", function () {
|
||||||
|
before(function () {
|
||||||
|
// Set config sample for use in test
|
||||||
|
process.env.MM_CONFIG_FILE = "tests/configs/modules/alert/default.js";
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should show the welcome message", function () {
|
||||||
|
return app.client.waitUntilTextExists(".ns-box .ns-box-inner .light.bright.small", "Welcome, start was successful!", 10000);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
@ -1,4 +1,5 @@
|
|||||||
const helpers = require("../global-setup");
|
const helpers = require("../global-setup");
|
||||||
|
const expect = require("chai").expect;
|
||||||
|
|
||||||
const describe = global.describe;
|
const describe = global.describe;
|
||||||
const it = global.it;
|
const it = global.it;
|
||||||
@ -36,6 +37,12 @@ describe("Newsfeed module", function () {
|
|||||||
it("should show the newsfeed article", function () {
|
it("should show the newsfeed article", function () {
|
||||||
return app.client.waitUntilTextExists(".newsfeed .newsfeed-title", "QPanel", 10000);
|
return app.client.waitUntilTextExists(".newsfeed .newsfeed-title", "QPanel", 10000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should NOT show the newsfeed description", async () => {
|
||||||
|
await app.client.waitUntilTextExists(".newsfeed .newsfeed-title", "QPanel", 10000);
|
||||||
|
const events = await app.client.$$(".newsfeed .newsfeed-desc");
|
||||||
|
return expect(events.length).equals(0);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Custom configuration", function () {
|
describe("Custom configuration", function () {
|
||||||
@ -46,6 +53,12 @@ describe("Newsfeed module", function () {
|
|||||||
it("should not show articles with prohibited words", function () {
|
it("should not show articles with prohibited words", function () {
|
||||||
return app.client.waitUntilTextExists(".newsfeed .newsfeed-title", "Problema VirtualBox", 10000);
|
return app.client.waitUntilTextExists(".newsfeed .newsfeed-title", "Problema VirtualBox", 10000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should show the newsfeed description", async () => {
|
||||||
|
await app.client.waitUntilTextExists(".newsfeed .newsfeed-title", "Problema VirtualBox", 10000);
|
||||||
|
const events = await app.client.$$(".newsfeed .newsfeed-desc");
|
||||||
|
return expect(events.length).equals(1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Invalid configuration", function () {
|
describe("Invalid configuration", function () {
|
||||||
|
@ -139,7 +139,7 @@ describe("Weather module", function () {
|
|||||||
const weather = generateWeather();
|
const weather = generateWeather();
|
||||||
await setup({ template, data: weather });
|
await setup({ template, data: weather });
|
||||||
|
|
||||||
return getText(".weather .large.light span.bright", "1°C") && getText(".weather .normal.medium.feelslike span.dimmed", "Feels like -6°C");
|
return (await getText(".weather .large.light span.bright", "1°C")) && (await getText(".weather .normal.medium.feelslike span.dimmed", "Feels like -6°C"));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -161,10 +161,10 @@ describe("Weather module", function () {
|
|||||||
});
|
});
|
||||||
await setup({ template, data: weather });
|
await setup({ template, data: weather });
|
||||||
|
|
||||||
return getText(".weather .normal.medium span:nth-child(2)", "6 WSW") && getText(".weather .large.light span.bright", "34,7°") && getText(".weather .normal.medium.feelslike span.dimmed", "Feels like 22,0°");
|
return (await getText(".weather .normal.medium span:nth-child(2)", "6 WSW")) && (await getText(".weather .large.light span.bright", "34,7°")) && getText(".weather .normal.medium.feelslike span.dimmed", "Feels like 22,0°");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should render decimalSymbol = ','", async function () {
|
it("should render custom decimalSymbol = ','", async function () {
|
||||||
const weather = generateWeather({
|
const weather = generateWeather({
|
||||||
main: {
|
main: {
|
||||||
temp: (1.49 * 9) / 5 + 32,
|
temp: (1.49 * 9) / 5 + 32,
|
||||||
@ -177,7 +177,7 @@ describe("Weather module", function () {
|
|||||||
});
|
});
|
||||||
await setup({ template, data: weather });
|
await setup({ template, data: weather });
|
||||||
|
|
||||||
return getText(".weather .normal.medium span:nth-child(3)", "93,7") && getText(".weather .large.light span.bright", "34,7°") && getText(".weather .normal.medium.feelslike span.dimmed", "Feels like 22,0°");
|
return (await getText(".weather .normal.medium span:nth-child(3)", "93,7")) && (await getText(".weather .large.light span.bright", "34,7°")) && getText(".weather .normal.medium.feelslike span.dimmed", "Feels like 22,0°");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -201,7 +201,7 @@ describe("Weather module", function () {
|
|||||||
const days = ["Today", "Tomorrow", "Sun", "Mon", "Tue"];
|
const days = ["Today", "Tomorrow", "Sun", "Mon", "Tue"];
|
||||||
|
|
||||||
for (const [index, day] of days.entries()) {
|
for (const [index, day] of days.entries()) {
|
||||||
getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(1)`, day);
|
await getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(1)`, day);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ describe("Weather module", function () {
|
|||||||
const icons = ["day-cloudy", "rain", "day-sunny", "day-sunny", "day-sunny"];
|
const icons = ["day-cloudy", "rain", "day-sunny", "day-sunny", "day-sunny"];
|
||||||
|
|
||||||
for (const [index, icon] of icons.entries()) {
|
for (const [index, icon] of icons.entries()) {
|
||||||
getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(2) span.wi-${icon}`);
|
await getElement(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(2) span.wi-${icon}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ describe("Weather module", function () {
|
|||||||
const temperatures = ["24.4°", "21.0°", "22.9°", "23.4°", "20.6°"];
|
const temperatures = ["24.4°", "21.0°", "22.9°", "23.4°", "20.6°"];
|
||||||
|
|
||||||
for (const [index, temp] of temperatures.entries()) {
|
for (const [index, temp] of temperatures.entries()) {
|
||||||
getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(3)`, temp);
|
await getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(3)`, temp);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -234,7 +234,7 @@ describe("Weather module", function () {
|
|||||||
const temperatures = ["15.3°", "13.6°", "13.8°", "13.9°", "10.9°"];
|
const temperatures = ["15.3°", "13.6°", "13.8°", "13.9°", "10.9°"];
|
||||||
|
|
||||||
for (const [index, temp] of temperatures.entries()) {
|
for (const [index, temp] of temperatures.entries()) {
|
||||||
getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(4)`, temp);
|
await getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(4)`, temp);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -274,5 +274,22 @@ describe("Weather module", function () {
|
|||||||
expect(rows.length).to.be.equal(5);
|
expect(rows.length).to.be.equal(5);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("Forecast weather units", function () {
|
||||||
|
before(function () {
|
||||||
|
process.env.MM_CONFIG_FILE = "tests/configs/modules/weather/forecastweather_units.js";
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should render custom decimalSymbol = '_'", async function () {
|
||||||
|
const weather = generateWeatherForecast();
|
||||||
|
await setup({ template, data: weather });
|
||||||
|
|
||||||
|
const temperatures = ["24_4°", "21_0°", "22_9°", "23_4°", "20_6°"];
|
||||||
|
|
||||||
|
for (const [index, temp] of temperatures.entries()) {
|
||||||
|
await getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(3)`, temp);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
"NNW": "NNW",
|
"NNW": "NNW",
|
||||||
|
|
||||||
"FEELS": "Gefühlt {DEGREE}",
|
"FEELS": "Gefühlt {DEGREE}",
|
||||||
|
"PRECIP": "Niederschlagswahrscheinlichkeit",
|
||||||
|
|
||||||
"MODULE_CONFIG_CHANGED": "Die Konfigurationsoptionen für das {MODULE_NAME} Modul haben sich geändert. \nBitte überprüfen Sie die Dokumentation.",
|
"MODULE_CONFIG_CHANGED": "Die Konfigurationsoptionen für das {MODULE_NAME} Modul haben sich geändert. \nBitte überprüfen Sie die Dokumentation.",
|
||||||
"MODULE_CONFIG_ERROR": "Fehler im {MODULE_NAME} Modul. {ERROR}",
|
"MODULE_CONFIG_ERROR": "Fehler im {MODULE_NAME} Modul. {ERROR}",
|
||||||
|
@ -26,8 +26,10 @@
|
|||||||
"NNW": "NNO",
|
"NNW": "NNO",
|
||||||
|
|
||||||
"FEELS": "Ressenti {DEGREE}",
|
"FEELS": "Ressenti {DEGREE}",
|
||||||
|
"PRECIP": "Probabilité de précipitations",
|
||||||
|
|
||||||
"MODULE_CONFIG_CHANGED": "Les options de configuration du module {MODULE_NAME} ont changé. \nVeuillez consulter la documentation.",
|
"MODULE_CONFIG_CHANGED": "Les options de configuration du module {MODULE_NAME} ont changé. \nVeuillez consulter la documentation.",
|
||||||
|
"MODULE_CONFIG_ERROR": "Erreur dans le module {MODULE_NAME}. {ERROR}",
|
||||||
|
|
||||||
"UPDATE_NOTIFICATION": "Une mise à jour de MagicMirror² est disponible",
|
"UPDATE_NOTIFICATION": "Une mise à jour de MagicMirror² est disponible",
|
||||||
"UPDATE_NOTIFICATION_MODULE": "Une mise à jour est disponible pour le module {MODULE_NAME} .",
|
"UPDATE_NOTIFICATION_MODULE": "Une mise à jour est disponible pour le module {MODULE_NAME} .",
|
||||||
|
146
vendor/package-lock.json
generated
vendored
Normal file
146
vendor/package-lock.json
generated
vendored
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
{
|
||||||
|
"name": "magicmirror-vendors",
|
||||||
|
"lockfileVersion": 2,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "magicmirror-vendors",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@fortawesome/fontawesome-free": "^5.15.3",
|
||||||
|
"moment": "^2.29.1",
|
||||||
|
"moment-timezone": "^0.5.33",
|
||||||
|
"nunjucks": "^3.2.3",
|
||||||
|
"suncalc": "^1.8.0",
|
||||||
|
"weathericons": "^2.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@fortawesome/fontawesome-free": {
|
||||||
|
"version": "5.15.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.3.tgz",
|
||||||
|
"integrity": "sha512-rFnSUN/QOtnOAgqFRooTA3H57JLDm0QEG/jPdk+tLQNL/eWd+Aok8g3qCI+Q1xuDPWpGW/i9JySpJVsq8Q0s9w==",
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/a-sync-waterfall": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA=="
|
||||||
|
},
|
||||||
|
"node_modules/asap": {
|
||||||
|
"version": "2.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
|
||||||
|
"integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY="
|
||||||
|
},
|
||||||
|
"node_modules/commander": {
|
||||||
|
"version": "5.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz",
|
||||||
|
"integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/moment": {
|
||||||
|
"version": "2.29.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
|
||||||
|
"integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/moment-timezone": {
|
||||||
|
"version": "0.5.33",
|
||||||
|
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.33.tgz",
|
||||||
|
"integrity": "sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==",
|
||||||
|
"dependencies": {
|
||||||
|
"moment": ">= 2.9.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/nunjucks": {
|
||||||
|
"version": "3.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/nunjucks/-/nunjucks-3.2.3.tgz",
|
||||||
|
"integrity": "sha512-psb6xjLj47+fE76JdZwskvwG4MYsQKXUtMsPh6U0YMvmyjRtKRFcxnlXGWglNybtNTNVmGdp94K62/+NjF5FDQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"a-sync-waterfall": "^1.0.0",
|
||||||
|
"asap": "^2.0.3",
|
||||||
|
"commander": "^5.1.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"nunjucks-precompile": "bin/precompile"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6.9.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/suncalc": {
|
||||||
|
"version": "1.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/suncalc/-/suncalc-1.8.0.tgz",
|
||||||
|
"integrity": "sha1-HZiYEJVjB4dQ9JlKlZ5lTYdqy/U="
|
||||||
|
},
|
||||||
|
"node_modules/weathericons": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/weathericons/-/weathericons-2.1.0.tgz",
|
||||||
|
"integrity": "sha1-dFOho14gAkXjiftQd9Un7/MLc7Q="
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@fortawesome/fontawesome-free": {
|
||||||
|
"version": "5.15.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.3.tgz",
|
||||||
|
"integrity": "sha512-rFnSUN/QOtnOAgqFRooTA3H57JLDm0QEG/jPdk+tLQNL/eWd+Aok8g3qCI+Q1xuDPWpGW/i9JySpJVsq8Q0s9w=="
|
||||||
|
},
|
||||||
|
"a-sync-waterfall": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA=="
|
||||||
|
},
|
||||||
|
"asap": {
|
||||||
|
"version": "2.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
|
||||||
|
"integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY="
|
||||||
|
},
|
||||||
|
"commander": {
|
||||||
|
"version": "5.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz",
|
||||||
|
"integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg=="
|
||||||
|
},
|
||||||
|
"moment": {
|
||||||
|
"version": "2.29.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
|
||||||
|
"integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
|
||||||
|
},
|
||||||
|
"moment-timezone": {
|
||||||
|
"version": "0.5.33",
|
||||||
|
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.33.tgz",
|
||||||
|
"integrity": "sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==",
|
||||||
|
"requires": {
|
||||||
|
"moment": ">= 2.9.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nunjucks": {
|
||||||
|
"version": "3.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/nunjucks/-/nunjucks-3.2.3.tgz",
|
||||||
|
"integrity": "sha512-psb6xjLj47+fE76JdZwskvwG4MYsQKXUtMsPh6U0YMvmyjRtKRFcxnlXGWglNybtNTNVmGdp94K62/+NjF5FDQ==",
|
||||||
|
"requires": {
|
||||||
|
"a-sync-waterfall": "^1.0.0",
|
||||||
|
"asap": "^2.0.3",
|
||||||
|
"commander": "^5.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"suncalc": {
|
||||||
|
"version": "1.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/suncalc/-/suncalc-1.8.0.tgz",
|
||||||
|
"integrity": "sha1-HZiYEJVjB4dQ9JlKlZ5lTYdqy/U="
|
||||||
|
},
|
||||||
|
"weathericons": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/weathericons/-/weathericons-2.1.0.tgz",
|
||||||
|
"integrity": "sha1-dFOho14gAkXjiftQd9Un7/MLc7Q="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user