mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-07-04 22:58:03 +00:00
commit
c51e613568
6
.gitignore
vendored
6
.gitignore
vendored
@ -59,12 +59,6 @@ Temporary Items
|
||||
.directory
|
||||
.Trash-*
|
||||
|
||||
# Various Magic Mirror ignoramuses and anti-ignoramuses.
|
||||
|
||||
# Don't ignore the node_helper core module.
|
||||
!/modules/node_helper
|
||||
!/modules/node_helper/**
|
||||
|
||||
# Ignore all modules except the default modules.
|
||||
/modules/**
|
||||
!/modules/default
|
||||
|
14
.snyk
14
.snyk
@ -1,14 +0,0 @@
|
||||
version: v1.5.2
|
||||
ignore: {}
|
||||
patch:
|
||||
'npm:minimatch:20160620':
|
||||
- snyk > recursive-readdir > minimatch:
|
||||
patched: '2016-07-30T14:02:31.280Z'
|
||||
'npm:negotiator:20160616':
|
||||
- socket.io > engine.io > accepts > negotiator:
|
||||
patched: '2016-07-30T14:02:31.280Z'
|
||||
'npm:ws:20160624':
|
||||
- socket.io > engine.io > ws:
|
||||
patched: '2016-07-30T14:02:31.280Z'
|
||||
- socket.io > socket.io-client > engine.io-client > ws:
|
||||
patched: '2016-07-30T14:02:31.280Z'
|
@ -1,12 +1,9 @@
|
||||
dist: trusty
|
||||
language: node_js
|
||||
node_js:
|
||||
- "10
|
||||
|
||||
- "10"
|
||||
before_install:
|
||||
- npm i -g npm
|
||||
|
||||
|
||||
before_script:
|
||||
- yarn danger ci
|
||||
- npm install grunt-cli -g
|
||||
@ -14,9 +11,9 @@ before_script:
|
||||
- "sh -e /etc/init.d/xvfb start"
|
||||
- sleep 5
|
||||
script:
|
||||
- grunt
|
||||
- npm run test:unit
|
||||
- npm run test:e2e
|
||||
- npm run test:unit
|
||||
- grunt
|
||||
after_script:
|
||||
- npm list
|
||||
cache:
|
||||
|
53
CHANGELOG.md
53
CHANGELOG.md
@ -3,42 +3,47 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
## Updated
|
||||
- fix handling of config.js for serverOnly mode commented out
|
||||
- only check for xwindows running if not on macOS
|
||||
|
||||
### Added
|
||||
- move node_helper module to dedicated github repo, to prevent being erased accidentally
|
||||
|
||||
- new upgrade script to help users consume regular updates installers/upgrade-script.sh
|
||||
- new script to help setup pm2, without install installers/fixuppm2.sh
|
||||
|
||||
### Updated
|
||||
- updated compliments.js to handle newline in text, as textfields to not interpolate contents
|
||||
- updated raspberry.sh installer script to handle new platform issues, split node/npm, pm2, and screen saver changes
|
||||
- improve handling for armv6l devices, where electron support has gone away, add optional serveronly config option
|
||||
- improved run-start.sh to handle for serveronly mode, by choice, or when electron not available
|
||||
- change electron version
|
||||
|
||||
❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/donate) With your help we can continue to improve the MagicMirror² core.
|
||||
|
||||
## [2.10.0] - Unreleased (Develop Branch)
|
||||
## [2.11.0] - Unreleased (Develop Branch)
|
||||
|
||||
*This release is scheduled to be released on 2020-01-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).
|
||||
*This release is scheduled to be released on 2020-04-01.*
|
||||
|
||||
### Added
|
||||
- Timestamps in log output
|
||||
- Padding in dateheader mode of the calendar module
|
||||
- Finnish translation for "PRECIP", "UPDATE_INFO_MULTIPLE" and "UPDATE_INFO_SINGLE".
|
||||
|
||||
### Fixed
|
||||
- Force declaration of public ip adress in config file (ISSUE #1852)
|
||||
|
||||
### Updated
|
||||
|
||||
## [2.10.0] - 2020-01-01
|
||||
|
||||
Special thanks to @sdetweil for all his great contributions!
|
||||
|
||||
ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`.
|
||||
|
||||
### Added
|
||||
- Timestamps in log output.
|
||||
- Padding in dateheader mode of the calendar module.
|
||||
- New upgrade script to help users consume regular updates installers/upgrade-script.sh.
|
||||
- New script to help setup pm2, without install installers/fixuppm2.sh.
|
||||
|
||||
### Updated
|
||||
- Updated lower bound of `lodash` and `helmet` dependencies for security patches.
|
||||
- Updated compliments.js to handle newline in text, as textfields to not interpolate contents.
|
||||
- Updated raspberry.sh installer script to handle new platform issues, split node/npm, pm2, and screen saver changes.
|
||||
- Improve handling for armv6l devices, where electron support has gone away, add optional serveronly config option.
|
||||
- Improved run-start.sh to handle for serveronly mode, by choice, or when electron not available.
|
||||
- Only check for xwindows running if not on macOS.
|
||||
|
||||
### Fixed
|
||||
- Fixed issue in weatherforecast module where predicted amount of rain was not using the decimal symbol specified in config.js.
|
||||
- Module header now updates correctly, if a module need to dynamically show/hide its header based on a condition.
|
||||
- Fix handling of config.js for serverOnly mode commented out.
|
||||
- Fixed issue in calendar module where the debug script didn't work correctly with authentication.
|
||||
- Fixed issue that some full day events were not correctly recognized as such.
|
||||
- Display full day events lasting multiple days as happening today instead of some days ago if they are still ongoing.
|
||||
|
||||
## [2.9.0] - 2019-10-01
|
||||
|
||||
|
@ -227,7 +227,7 @@ A real Manifesto is still to be written. Till then, Michael's response on [one o
|
||||
>
|
||||
>Of course, a bundled version can be complimentary to the regular un-bundled version. And I'm sure a lot of (new) users will opt for the bundled version. But this means those users won't be motivated to take a peek under the hood. They will just remain 'users'. They won't become contributors, and worse: they won't be motivated to take their first steps in software development.
|
||||
>
|
||||
>And to be honest: motivating curious users to step out of their comfort zone and take those first steps is what drives me in this project. Therefor my ultimate goal is this project is to keep it as accessible as possible."
|
||||
>And to be honest: motivating curious users to step out of their comfort zone and take those first steps is what drives me in this project. Therefore my ultimate goal is this project is to keep it as accessible as possible."
|
||||
>
|
||||
> ~ Michael Teeuw
|
||||
|
||||
|
@ -12,8 +12,8 @@ var config = {
|
||||
address: "localhost", // Address to listen on, can be:
|
||||
// - "localhost", "127.0.0.1", "::1" to listen on loopback interface
|
||||
// - another specific IPv4/6 to listen on a specific interface
|
||||
// - "", "0.0.0.0", "::" to listen on any interface
|
||||
// Default, when address config is left out, is "localhost"
|
||||
// - "0.0.0.0", "::" to listen on any interface
|
||||
// Default, when address config is left out or empty, is "localhost"
|
||||
port: 8080,
|
||||
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses
|
||||
// or add a specific IPv4 of 192.168.1.5 :
|
||||
|
@ -11,8 +11,11 @@ var Utils = require(__dirname + "/utils.js");
|
||||
var defaultModules = require(__dirname + "/../modules/default/defaultmodules.js");
|
||||
var path = require("path");
|
||||
|
||||
// Alias modules mentioned in package.js under _moduleAliases.
|
||||
require("module-alias/register");
|
||||
|
||||
// add timestamps in front of log messages
|
||||
require('console-stamp')(console, 'HH:MM:ss.l');
|
||||
require("console-stamp")(console, "HH:MM:ss.l");
|
||||
|
||||
// Get version number.
|
||||
global.version = JSON.parse(fs.readFileSync("package.json", "utf8")).version;
|
||||
|
125
js/node_helper.js
Normal file
125
js/node_helper.js
Normal file
@ -0,0 +1,125 @@
|
||||
/* Magic Mirror
|
||||
* Node Helper Superclass
|
||||
*
|
||||
* By Michael Teeuw http://michaelteeuw.nl
|
||||
* MIT Licensed.
|
||||
*/
|
||||
|
||||
var Class = require("./class.js");
|
||||
var express = require("express");
|
||||
var path = require("path");
|
||||
|
||||
NodeHelper = Class.extend({
|
||||
init: function() {
|
||||
console.log("Initializing new module helper ...");
|
||||
},
|
||||
|
||||
loaded: function(callback) {
|
||||
console.log("Module helper loaded: " + this.name);
|
||||
callback();
|
||||
},
|
||||
|
||||
start: function() {
|
||||
console.log("Starting module helper: " + this.name);
|
||||
},
|
||||
|
||||
/* stop()
|
||||
* Called when the MagicMirror server receives a `SIGINT`
|
||||
* Close any open connections, stop any sub-processes and
|
||||
* gracefully exit the module.
|
||||
*
|
||||
*/
|
||||
stop: function() {
|
||||
console.log("Stopping module helper: " + this.name);
|
||||
},
|
||||
|
||||
/* socketNotificationReceived(notification, payload)
|
||||
* This method is called when a socket notification arrives.
|
||||
*
|
||||
* argument notification string - The identifier of the notification.
|
||||
* argument payload mixed - The payload of the notification.
|
||||
*/
|
||||
socketNotificationReceived: function(notification, payload) {
|
||||
console.log(this.name + " received a socket notification: " + notification + " - Payload: " + payload);
|
||||
},
|
||||
|
||||
/* setName(name)
|
||||
* Set the module name.
|
||||
*
|
||||
* argument name string - Module name.
|
||||
*/
|
||||
setName: function(name) {
|
||||
this.name = name;
|
||||
},
|
||||
|
||||
/* setPath(path)
|
||||
* Set the module path.
|
||||
*
|
||||
* argument path string - Module path.
|
||||
*/
|
||||
setPath: function(path) {
|
||||
this.path = path;
|
||||
},
|
||||
|
||||
/* sendSocketNotification(notification, payload)
|
||||
* Send a socket notification to the node helper.
|
||||
*
|
||||
* argument notification string - The identifier of the notification.
|
||||
* argument payload mixed - The payload of the notification.
|
||||
*/
|
||||
sendSocketNotification: function(notification, payload) {
|
||||
this.io.of(this.name).emit(notification, payload);
|
||||
},
|
||||
|
||||
/* setExpressApp(app)
|
||||
* Sets the express app object for this module.
|
||||
* This allows you to host files from the created webserver.
|
||||
*
|
||||
* argument app Express app - The Express app object.
|
||||
*/
|
||||
setExpressApp: function(app) {
|
||||
this.expressApp = app;
|
||||
|
||||
var publicPath = this.path + "/public";
|
||||
app.use("/" + this.name, express.static(publicPath));
|
||||
},
|
||||
|
||||
/* setSocketIO(io)
|
||||
* Sets the socket io object for this module.
|
||||
* Binds message receiver.
|
||||
*
|
||||
* argument io Socket.io - The Socket io object.
|
||||
*/
|
||||
setSocketIO: function(io) {
|
||||
var self = this;
|
||||
self.io = io;
|
||||
|
||||
console.log("Connecting socket for: " + this.name);
|
||||
var namespace = this.name;
|
||||
io.of(namespace).on("connection", function(socket) {
|
||||
// add a catch all event.
|
||||
var onevent = socket.onevent;
|
||||
socket.onevent = function(packet) {
|
||||
var args = packet.data || [];
|
||||
onevent.call(this, packet); // original call
|
||||
packet.data = ["*"].concat(args);
|
||||
onevent.call(this, packet); // additional call to catch-all
|
||||
};
|
||||
|
||||
// register catch all.
|
||||
socket.on("*", function(notification, payload) {
|
||||
if (notification !== "*") {
|
||||
//console.log('received message in namespace: ' + namespace);
|
||||
self.socketNotificationReceived(notification, payload);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
NodeHelper.create = function(moduleDefinition) {
|
||||
return NodeHelper.extend(moduleDefinition);
|
||||
};
|
||||
|
||||
module.exports = NodeHelper;
|
@ -306,6 +306,11 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri
|
||||
continue;
|
||||
}
|
||||
|
||||
// adjust start date so multiple day events will be displayed as happening today even though they started some days ago already
|
||||
if (fullDayEvent && startDate <= today) {
|
||||
startDate = moment(today);
|
||||
}
|
||||
|
||||
// Every thing is good. Add it to the list.
|
||||
|
||||
newEvents.push({
|
||||
@ -355,7 +360,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri
|
||||
* return bool - The event is a fullday event.
|
||||
*/
|
||||
var isFullDayEvent = function(event) {
|
||||
if (event.start.length === 8) {
|
||||
if (event.start.length === 8 || event.start.dateOnly) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ var auth = {
|
||||
|
||||
console.log("Create fetcher ...");
|
||||
|
||||
fetcher = new CalendarFetcher(url, fetchInterval, maximumEntries, maximumNumberOfDays, auth);
|
||||
fetcher = new CalendarFetcher(url, fetchInterval, [], maximumEntries, maximumNumberOfDays, auth);
|
||||
|
||||
fetcher.onReceive(function(fetcher) {
|
||||
console.log(fetcher.events());
|
||||
@ -38,4 +38,4 @@ fetcher.onError(function(fetcher, error) {
|
||||
|
||||
fetcher.startFetch();
|
||||
|
||||
console.log("Create fetcher done! ");
|
||||
console.log("Create fetcher done! ");
|
||||
|
3257
package-lock.json
generated
3257
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
21
package.json
21
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "magicmirror",
|
||||
"version": "2.10.0-develop",
|
||||
"version": "2.11.0-develop",
|
||||
"description": "The open source modular smart mirror platform.",
|
||||
"main": "js/electron.js",
|
||||
"scripts": {
|
||||
@ -34,8 +34,8 @@
|
||||
},
|
||||
"homepage": "https://magicmirror.builders",
|
||||
"devDependencies": {
|
||||
"chai": "latest",
|
||||
"chai-as-promised": "latest",
|
||||
"chai": "^4.1.2",
|
||||
"chai-as-promised": "^7.1.1",
|
||||
"current-week-number": "^1.0.7",
|
||||
"danger": "^3.1.3",
|
||||
"grunt": "latest",
|
||||
@ -47,16 +47,16 @@
|
||||
"http-auth": "^3.2.3",
|
||||
"jsdom": "^11.6.2",
|
||||
"jshint": "^2.10.2",
|
||||
"mocha": "latest",
|
||||
"mocha-each": "latest",
|
||||
"mocha-logger": "latest",
|
||||
"spectron": "^8.0.0",
|
||||
"mocha": "^4.1.0",
|
||||
"mocha-each": "^1.1.0",
|
||||
"mocha-logger": "^1.0.6",
|
||||
"spectron": "^3.8.0",
|
||||
"stylelint": "latest",
|
||||
"stylelint-config-standard": "latest",
|
||||
"time-grunt": "latest"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"electron": "^6.0.12"
|
||||
"electron": "^3.0.13"
|
||||
},
|
||||
"dependencies": {
|
||||
"colors": "^1.1.2",
|
||||
@ -67,13 +67,16 @@
|
||||
"helmet": "^3.21.2",
|
||||
"iconv-lite": "latest",
|
||||
"lodash": "^4.17.15",
|
||||
"module-alias": "^2.2.2",
|
||||
"moment": "latest",
|
||||
"node_helper": "git://github.com/sdetweil/nodehelper.git",
|
||||
"request": "^2.88.0",
|
||||
"rrule": "^2.6.2",
|
||||
"rrule-alt": "^2.2.8",
|
||||
"simple-git": "^1.85.0",
|
||||
"socket.io": "^2.1.1",
|
||||
"valid-url": "latest"
|
||||
},
|
||||
"_moduleAliases": {
|
||||
"node_helper": "js/node_helper.js"
|
||||
}
|
||||
}
|
||||
|
@ -11,12 +11,6 @@ const {generateWeather, generateWeatherForecast} = require("./mocks");
|
||||
const wait = () => new Promise(res => setTimeout(res, 3000));
|
||||
|
||||
describe("Weather module", function() {
|
||||
before(function() {
|
||||
// Skipping the weather tests for now since these seem to give issues.
|
||||
// Please send a PR if you know how to fix these. Thanks!
|
||||
this.skip();
|
||||
});
|
||||
|
||||
let app;
|
||||
|
||||
helpers.setupTimeout(this);
|
||||
|
@ -28,6 +28,9 @@
|
||||
|
||||
"UPDATE_NOTIFICATION": "MagicMirror² päivitys saatavilla.",
|
||||
"UPDATE_NOTIFICATION_MODULE": "Päivitys saatavilla moduulille {MODULE_NAME}.",
|
||||
"UPDATE_INFO_SINGLE": "Nykyasennus on {COMMIT_COUNT} muutoksen jäljessä {BRANCH_NAME} haaraan nähden.",
|
||||
"UPDATE_INFO_MULTIPLE": "Nykyasennus on {COMMIT_COUNT} muutosta jäljessä {BRANCH_NAME} haaraan nähden.",
|
||||
|
||||
"FEELS": "Tuntuu kuin"
|
||||
"FEELS": "Tuntuu kuin",
|
||||
"PRECIP": "Sateen todennäköisyys"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user