mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Merge branch 'develop' of https://github.com/artifactdev/MagicMirror
# Conflicts: # modules/default/calendar/README.md # modules/default/weatherforecast/README.md
This commit is contained in:
commit
bc257f4951
1
.gitignore
vendored
1
.gitignore
vendored
@ -59,6 +59,7 @@ Temporary Items
|
|||||||
|
|
||||||
# Ignore all modules except the default modules.
|
# Ignore all modules except the default modules.
|
||||||
/modules/**
|
/modules/**
|
||||||
|
!/modules/default
|
||||||
!/modules/default/**
|
!/modules/default/**
|
||||||
!/modules/README.md**
|
!/modules/README.md**
|
||||||
|
|
||||||
|
@ -4,4 +4,9 @@ node_js:
|
|||||||
- "5.1"
|
- "5.1"
|
||||||
before_script:
|
before_script:
|
||||||
- npm install grunt-cli -g
|
- npm install grunt-cli -g
|
||||||
script: grunt
|
script:
|
||||||
|
- grunt
|
||||||
|
- npm test
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- node_modules
|
||||||
|
37
CHANGELOG.md
37
CHANGELOG.md
@ -2,6 +2,41 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
## [2.1.1] - Unreleased
|
||||||
|
|
||||||
|
**Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Installer: Use init config.js from config.js.sample.
|
||||||
|
- Switched out `rrule` package for `rrule-alt` and fixes in `ical.js` in order to fix calendar issues. ([#565](https://github.com/MichMich/MagicMirror/issues/565))
|
||||||
|
- Make mouse events pass through the region fullscreen_above to modules below.
|
||||||
|
- Scaled the splash screen down to make it a bit more subtle.
|
||||||
|
- Replace HTML tables with markdown tables in README files.
|
||||||
|
- Added `DAYAFTERTOMORROW`, `UPDATE_NOTIFICATION` and `UPDATE_NOTIFICATION_MODULE` to Finnish translations.
|
||||||
|
- Run `npm test` on Travis automatically
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Add loaded function to modules, providing an async callback.
|
||||||
|
- Made default newsfeed module aware of gesture events from [MMM-Gestures](https://github.com/thobach/MMM-Gestures)
|
||||||
|
- Add use pm2 for manager process into Installer RaspberryPi script
|
||||||
|
- Russian Translation
|
||||||
|
- Afrikaans Translation
|
||||||
|
- Add postinstall script to notify user that MagicMirror installed successfully despite warnings from NPM.
|
||||||
|
- Init tests using mocha.
|
||||||
|
- 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.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Update .gitignore to not ignore default modules folder.
|
||||||
|
- Remove white flash on boot up.
|
||||||
|
- Added `update` in Raspberry Pi installation script.
|
||||||
|
- Fix an issue where the analog clock looked scrambled. ([#611](https://github.com/MichMich/MagicMirror/issues/611))
|
||||||
|
- If units is set to imperial, the showRainAmount option of weatherforecast will show the correct unit.
|
||||||
|
- Module currentWeather: check if temperature received from api is defined.
|
||||||
|
|
||||||
## [2.1.0] - 2016-12-31
|
## [2.1.0] - 2016-12-31
|
||||||
|
|
||||||
**Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`
|
**Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`
|
||||||
@ -118,7 +153,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Added reference to Italian Translation.
|
- Added reference to Italian Translation.
|
||||||
- Added the missing NE translation to all languages. [#334](https://github.com/MichMich/MagicMirror/issues/344)
|
- Added the missing NE translation to all languages. [#344](https://github.com/MichMich/MagicMirror/issues/344)
|
||||||
- Added proper User-Agent string to calendar call.
|
- Added proper User-Agent string to calendar call.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
@ -7,8 +7,9 @@ module.exports = function(grunt) {
|
|||||||
configFile: ".eslintrc.json"
|
configFile: ".eslintrc.json"
|
||||||
},
|
},
|
||||||
target: ["js/*.js", "modules/default/*.js", "modules/default/*/*.js",
|
target: ["js/*.js", "modules/default/*.js", "modules/default/*/*.js",
|
||||||
"serveronly/*.js", "*.js", "!modules/default/alert/notificationFx.js",
|
"serveronly/*.js", "*.js", "tests/*/*.js", "!modules/default/alert/notificationFx.js",
|
||||||
"!modules/default/alert/modernizr.custom.js", "!modules/default/alert/classie.js"
|
"!modules/default/alert/modernizr.custom.js", "!modules/default/alert/classie.js",
|
||||||
|
"config/*",
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
stylelint: {
|
stylelint: {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
Copyright © 2016 Michael Teeuw
|
Copyright © 2016-2017 Michael Teeuw
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person
|
Permission is hereby granted, free of charge, to any person
|
||||||
obtaining a copy of this software and associated documentation
|
obtaining a copy of this software and associated documentation
|
||||||
|
@ -19,7 +19,7 @@ MagicMirror² focuses on a modular plugin system and uses [Electron](http://elec
|
|||||||
- [Configuration](#configuration)
|
- [Configuration](#configuration)
|
||||||
- [Modules](#modules)
|
- [Modules](#modules)
|
||||||
- [Known Issues](#known-issues)
|
- [Known Issues](#known-issues)
|
||||||
- [community](#community)
|
- [Community](#community)
|
||||||
- [Contributing Guidelines](#contributing-guidelines)
|
- [Contributing Guidelines](#contributing-guidelines)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@ -37,7 +37,7 @@ curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/master/installer
|
|||||||
### Manual Installation
|
### Manual Installation
|
||||||
|
|
||||||
1. Download and install the latest Node.js version.
|
1. Download and install the latest Node.js version.
|
||||||
2. Clone the repository and check out the beta branch: `git clone https://github.com/MichMich/MagicMirror`
|
2. Clone the repository and check out the master branch: `git clone https://github.com/MichMich/MagicMirror`
|
||||||
3. Enter the repository: `cd ~/MagicMirror`
|
3. Enter the repository: `cd ~/MagicMirror`
|
||||||
4. Install and run the app: `npm install && npm start`
|
4. Install and run the app: `npm install && npm start`
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ Type `git status` to see your changes, if there are any, you can reset them with
|
|||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
1. Duplicate `config/config.js.sample` to `config/config.js`.
|
1. Duplicate `config/config.js.sample` to `config/config.js`. **Note:** If you used the installer script. This step is already done for you.
|
||||||
2. Modify your required settings.
|
2. Modify your required settings.
|
||||||
|
|
||||||
The following properties can be configured:
|
The following properties can be configured:
|
||||||
@ -83,7 +83,7 @@ The following properties can be configured:
|
|||||||
| `timeFormat` | The form of time notation that will be used. Possible values are `12` or `24`. The default is `24`. |
|
| `timeFormat` | The form of time notation that will be used. Possible values are `12` or `24`. The default is `24`. |
|
||||||
| `units` | The units that will be used in the default weather modules. Possible values are `metric` or `imperial`. The default is `metric`. |
|
| `units` | The units that will be used in the default weather modules. Possible values are `metric` or `imperial`. The default is `metric`. |
|
||||||
| `modules` | An array of active modules. **The array must contain objects. See the next table below for more information.** |
|
| `modules` | An array of active modules. **The array must contain objects. See the next table below for more information.** |
|
||||||
| `electronOptions` | An optional array of Electron (browser) options. This allows configuration of e.g. the browser screen size and position (defaults `.width = 800` & `.height = 600`). Kiosk mode can be enabled by setting `.kiosk = true`, `.autoHideMenuBar = false`, `.fullscreen = false`. More options can be found [here](https://github.com/electron/electron/blob/master/docs/api/browser-window.md). |
|
| `electronOptions` | An optional array of Electron (browser) options. This allows configuration of e.g. the browser screen size and position (example: `electronOptions: { fullscreen: false, width: 800, height: 600 }`). Kiosk mode can be enabled by setting `.kiosk = true`, `.autoHideMenuBar = false`, `.fullscreen = false`. More options can be found [here](https://github.com/electron/electron/blob/master/docs/api/browser-window.md). |
|
||||||
|
|
||||||
|
|
||||||
Module configuration:
|
Module configuration:
|
||||||
|
@ -8,61 +8,61 @@ var config = {
|
|||||||
port: 8080,
|
port: 8080,
|
||||||
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
|
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
|
||||||
|
|
||||||
language: 'en',
|
language: "en",
|
||||||
timeFormat: 24,
|
timeFormat: 24,
|
||||||
units: 'metric',
|
units: "metric",
|
||||||
|
|
||||||
modules: [
|
modules: [
|
||||||
{
|
{
|
||||||
module: 'alert',
|
module: "alert",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
module: "updatenotification",
|
module: "updatenotification",
|
||||||
position: "top_bar"
|
position: "top_bar"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
module: 'clock',
|
module: "clock",
|
||||||
position: 'top_left'
|
position: "top_left"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
module: 'calendar',
|
module: "calendar",
|
||||||
header: 'US Holidays',
|
header: "US Holidays",
|
||||||
position: 'top_left',
|
position: "top_left",
|
||||||
config: {
|
config: {
|
||||||
calendars: [
|
calendars: [
|
||||||
{
|
{
|
||||||
symbol: 'calendar-check-o ',
|
symbol: "calendar-check-o ",
|
||||||
url: 'webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics'
|
url: "webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
module: 'compliments',
|
module: "compliments",
|
||||||
position: 'lower_third'
|
position: "lower_third"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
module: 'currentweather',
|
module: "currentweather",
|
||||||
position: 'top_right',
|
position: "top_right",
|
||||||
config: {
|
config: {
|
||||||
location: 'New York',
|
location: "New York",
|
||||||
locationID: '', //ID from http://www.openweathermap.org
|
locationID: "", //ID from http://www.openweathermap.org
|
||||||
appid: 'YOUR_OPENWEATHER_API_KEY'
|
appid: "YOUR_OPENWEATHER_API_KEY"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
module: 'weatherforecast',
|
module: "weatherforecast",
|
||||||
position: 'top_right',
|
position: "top_right",
|
||||||
header: 'Weather Forecast',
|
header: "Weather Forecast",
|
||||||
config: {
|
config: {
|
||||||
location: 'New York',
|
location: "New York",
|
||||||
locationID: '5128581', //ID from http://www.openweathermap.org
|
locationID: "5128581", //ID from http://www.openweathermap.org
|
||||||
appid: 'YOUR_OPENWEATHER_API_KEY'
|
appid: "YOUR_OPENWEATHER_API_KEY"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
module: 'newsfeed',
|
module: "newsfeed",
|
||||||
position: 'bottom_bar',
|
position: "bottom_bar",
|
||||||
config: {
|
config: {
|
||||||
feeds: [
|
feeds: [
|
||||||
{
|
{
|
||||||
@ -79,4 +79,4 @@ var config = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||||
if (typeof module !== 'undefined') {module.exports = config;}
|
if (typeof module !== "undefined") {module.exports = config;}
|
||||||
|
@ -135,6 +135,11 @@ sup {
|
|||||||
left: -60px;
|
left: -60px;
|
||||||
right: -60px;
|
right: -60px;
|
||||||
bottom: -60px;
|
bottom: -60px;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.region.fullscreen * {
|
||||||
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.region.right {
|
.region.right {
|
||||||
|
2
installers/mm.sh
Executable file
2
installers/mm.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
cd ~/MagicMirror
|
||||||
|
DISPLAY=:0 npm start
|
7
installers/pm2_MagicMirror.json
Normal file
7
installers/pm2_MagicMirror.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
apps : [{
|
||||||
|
name : "MagicMirror",
|
||||||
|
script : "/home/pi/MagicMirror/installers/mm.sh",
|
||||||
|
watch : ["/home/pi/MagicMirror/config/config.js"]
|
||||||
|
}]
|
||||||
|
}
|
2
installers/postinstall/postinstall.sh
Normal file
2
installers/postinstall/postinstall.sh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
echo "\033[32mMagicMirror installation successful!"
|
||||||
|
exit 0
|
@ -36,6 +36,10 @@ fi
|
|||||||
function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; }
|
function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; }
|
||||||
function command_exists () { type "$1" &> /dev/null ;}
|
function command_exists () { type "$1" &> /dev/null ;}
|
||||||
|
|
||||||
|
# Update before first apt-get
|
||||||
|
echo -e "\e[96mUpdating packages ...\e[90m"
|
||||||
|
sudo apt-get update || echo -e "\e[91mUpdate failed, carrying on installation ...\e[90m"
|
||||||
|
|
||||||
# Installing helper tools
|
# Installing helper tools
|
||||||
echo -e "\e[96mInstalling helper tools ...\e[90m"
|
echo -e "\e[96mInstalling helper tools ...\e[90m"
|
||||||
sudo apt-get install curl wget git build-essential unzip || exit
|
sudo apt-get install curl wget git build-essential unzip || exit
|
||||||
@ -113,6 +117,9 @@ else
|
|||||||
exit;
|
exit;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Use sample config for start MagicMirror
|
||||||
|
cp config/config.js.sample config/config.js
|
||||||
|
|
||||||
# Check if plymouth is installed (default with PIXEL desktop environment), then install custom splashscreen.
|
# Check if plymouth is installed (default with PIXEL desktop environment), then install custom splashscreen.
|
||||||
echo -e "\e[96mCheck plymouth installation ...\e[0m"
|
echo -e "\e[96mCheck plymouth installation ...\e[0m"
|
||||||
if command_exists plymouth; then
|
if command_exists plymouth; then
|
||||||
@ -141,6 +148,16 @@ else
|
|||||||
echo -e "\e[93mplymouth is not installed.\e[0m";
|
echo -e "\e[93mplymouth is not installed.\e[0m";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Use pm2 control like a service MagicMirror
|
||||||
|
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
|
||||||
|
fi
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
echo -e "\e[92mWe're ready! Run \e[1m\e[97mDISPLAY=:0 npm start\e[0m\e[92m from the ~/MagicMirror directory to start your MagicMirror.\e[0m"
|
echo -e "\e[92mWe're ready! Run \e[1m\e[97mDISPLAY=:0 npm start\e[0m\e[92m from the ~/MagicMirror directory to start your MagicMirror.\e[0m"
|
||||||
echo " "
|
echo " "
|
||||||
|
65
js/app.js
65
js/app.js
@ -17,6 +17,10 @@ console.log("Starting MagicMirror: v" + global.version);
|
|||||||
// global absolute root path
|
// global absolute root path
|
||||||
global.root_path = path.resolve(__dirname + "/../");
|
global.root_path = path.resolve(__dirname + "/../");
|
||||||
|
|
||||||
|
if (process.env.MM_CONFIG_FILE) {
|
||||||
|
global.configuration_file = process.env.MM_CONFIG_FILE;
|
||||||
|
}
|
||||||
|
|
||||||
// The next part is here to prevent a major exception when there
|
// The next part is here to prevent a major exception when there
|
||||||
// is no internet connection. This could probable be solved better.
|
// is no internet connection. This could probable be solved better.
|
||||||
process.on("uncaughtException", function (err) {
|
process.on("uncaughtException", function (err) {
|
||||||
@ -41,7 +45,14 @@ var App = function() {
|
|||||||
var loadConfig = function(callback) {
|
var loadConfig = function(callback) {
|
||||||
console.log("Loading config ...");
|
console.log("Loading config ...");
|
||||||
var defaults = require(__dirname + "/defaults.js");
|
var defaults = require(__dirname + "/defaults.js");
|
||||||
|
|
||||||
|
// For this check proposed to TestSuite
|
||||||
|
// https://forum.magicmirror.builders/topic/1456/test-suite-for-magicmirror/8
|
||||||
var configFilename = path.resolve(global.root_path + "/config/config.js");
|
var configFilename = path.resolve(global.root_path + "/config/config.js");
|
||||||
|
if (typeof(global.configuration_file) === "undefined" ) {
|
||||||
|
configFilename = path.resolve(global.configuration_file);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fs.accessSync(configFilename, fs.F_OK);
|
fs.accessSync(configFilename, fs.F_OK);
|
||||||
var c = require(configFilename);
|
var c = require(configFilename);
|
||||||
@ -66,7 +77,7 @@ var App = function() {
|
|||||||
*
|
*
|
||||||
* argument module string - The name of the module (including subpath).
|
* argument module string - The name of the module (including subpath).
|
||||||
*/
|
*/
|
||||||
var loadModule = function(module) {
|
var loadModule = function(module, callback) {
|
||||||
|
|
||||||
var elements = module.split("/");
|
var elements = module.split("/");
|
||||||
var moduleName = elements[elements.length - 1];
|
var moduleName = elements[elements.length - 1];
|
||||||
@ -103,6 +114,10 @@ var App = function() {
|
|||||||
m.setName(moduleName);
|
m.setName(moduleName);
|
||||||
m.setPath(path.resolve(moduleFolder));
|
m.setPath(path.resolve(moduleFolder));
|
||||||
nodeHelpers.push(m);
|
nodeHelpers.push(m);
|
||||||
|
|
||||||
|
m.loaded(callback);
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -111,14 +126,24 @@ var App = function() {
|
|||||||
*
|
*
|
||||||
* argument module string - The name of the module (including subpath).
|
* argument module string - The name of the module (including subpath).
|
||||||
*/
|
*/
|
||||||
var loadModules = function(modules) {
|
var loadModules = function(modules, callback) {
|
||||||
console.log("Loading module helpers ...");
|
console.log("Loading module helpers ...");
|
||||||
|
|
||||||
for (var m in modules) {
|
var loadNextModule = function() {
|
||||||
loadModule(modules[m]);
|
if (modules.length > 0) {
|
||||||
}
|
var nextModule = modules[0];
|
||||||
|
loadModule(nextModule, function() {
|
||||||
|
modules = modules.slice(1);
|
||||||
|
loadNextModule();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// All modules are loaded
|
||||||
|
console.log("All module helpers loaded.");
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
console.log("All module helpers loaded.");
|
loadNextModule();
|
||||||
};
|
};
|
||||||
|
|
||||||
/* cmpVersions(a,b)
|
/* cmpVersions(a,b)
|
||||||
@ -164,24 +189,24 @@ var App = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loadModules(modules);
|
loadModules(modules, function() {
|
||||||
|
var server = new Server(config, function(app, io) {
|
||||||
|
console.log("Server started ...");
|
||||||
|
|
||||||
var server = new Server(config, function(app, io) {
|
for (var h in nodeHelpers) {
|
||||||
console.log("Server started ...");
|
var nodeHelper = nodeHelpers[h];
|
||||||
|
nodeHelper.setExpressApp(app);
|
||||||
|
nodeHelper.setSocketIO(io);
|
||||||
|
nodeHelper.start();
|
||||||
|
}
|
||||||
|
|
||||||
for (var h in nodeHelpers) {
|
console.log("Sockets connected & modules started ...");
|
||||||
var nodeHelper = nodeHelpers[h];
|
|
||||||
nodeHelper.setExpressApp(app);
|
|
||||||
nodeHelper.setSocketIO(io);
|
|
||||||
nodeHelper.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log("Sockets connected & modules started ...");
|
if (typeof callback === "function") {
|
||||||
|
callback(config);
|
||||||
if (typeof callback === "function") {
|
}
|
||||||
callback(config);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -28,7 +28,8 @@ function createWindow() {
|
|||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: false,
|
nodeIntegration: false,
|
||||||
zoomFactor: config.zoom
|
zoomFactor: config.zoom
|
||||||
}
|
},
|
||||||
|
backgroundColor: "#000000"
|
||||||
}
|
}
|
||||||
|
|
||||||
// DEPRECATED: "kioskmode" backwards compatibility, to be removed
|
// DEPRECATED: "kioskmode" backwards compatibility, to be removed
|
||||||
|
@ -415,3 +415,11 @@ Module.register = function (name, moduleDefinition) {
|
|||||||
Log.log("Module registered: " + name);
|
Log.log("Module registered: " + name);
|
||||||
Module.definitions[name] = moduleDefinition;
|
Module.definitions[name] = moduleDefinition;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (typeof exports != "undefined") { // For testing purpose only
|
||||||
|
// A good a idea move the function cmpversions a helper file.
|
||||||
|
// It's used into other side.
|
||||||
|
exports._test = {
|
||||||
|
cmpVersions: cmpVersions
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -96,6 +96,21 @@ requiresVersion: "2.1.0",
|
|||||||
####`init()`
|
####`init()`
|
||||||
This method is called when a module gets instantiated. In most cases you do not need to subclass this method.
|
This method is called when a module gets instantiated. In most cases you do not need to subclass this method.
|
||||||
|
|
||||||
|
####`loaded(callback)`
|
||||||
|
|
||||||
|
*Introduced in version: 2.1.1.*
|
||||||
|
|
||||||
|
This method is called when a module is loaded. Subsequent modules in the config are not yet loaded. The `callback` function MUST be called when the module is done loading. In most cases you do not need to subclass this method.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
````javascript
|
||||||
|
loaded: function(callback) {
|
||||||
|
this.finishLoading();
|
||||||
|
Log.log(this.name + ' is loaded!');
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
````
|
||||||
|
|
||||||
####`start()`
|
####`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 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:
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ To use this module, add it to the modules array in the config/config.js file:
|
|||||||
```
|
```
|
||||||
modules: [
|
modules: [
|
||||||
{
|
{
|
||||||
module: 'alert',
|
module: "alert",
|
||||||
config: {
|
config: {
|
||||||
// The config property is optional.
|
// The config property is optional.
|
||||||
// See 'Configuration options' for more information.
|
// See 'Configuration options' for more information.
|
||||||
@ -21,52 +21,13 @@ modules: [
|
|||||||
The following properties can be configured:
|
The following properties can be configured:
|
||||||
|
|
||||||
|
|
||||||
<table width="100%">
|
| Option | Description
|
||||||
<!-- why, markdown... -->
|
| ----------------- | -----------
|
||||||
<thead>
|
| `effect` | The animation effect to use for notifications. <br><br> **Possible values:** `scale` `slide` `genie` `jelly` `flip` `exploader` `bouncyflip` <br> **Default value:** `slide`
|
||||||
<tr>
|
| `alert_effect` | The animation effect to use for alerts. <br><br> **Possible values:** `scale` `slide` `genie` `jelly` `flip` `exploader` `bouncyflip` <br> **Default value:** `jelly`
|
||||||
<th>Option</th>
|
| `display_time` | Time a notification is displayed in milliseconds. <br><br> **Possible values:** `int` <br> **Default value:** `3500`
|
||||||
<th width="100%">Description</th>
|
| `position` | Position where the notifications should be displayed. <br><br> **Possible values:** `left` `center` `right` <br> **Default value:** `center`
|
||||||
</tr>
|
| `welcome_message` | Message shown at startup. <br><br> **Possible values:** `string` `false` <br> **Default value:** `false` (no message at startup)
|
||||||
<thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td><code>effect</code></td>
|
|
||||||
<td>The animation effect to use for notifications.<br>
|
|
||||||
<br><b>Possible values:</b> <code>scale</code> <code>slide</code> <code>genie</code> <code>jelly</code> <code>flip</code> <code>exploader</code> <code>bouncyflip</code>
|
|
||||||
<br><b>Default value:</b> <code>slide</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<td><code>alert_effect</code></td>
|
|
||||||
<td>The animation effect to use for alerts.<br>
|
|
||||||
<br><b>Possible values:</b> <code>scale</code> <code>slide</code> <code>genie</code> <code>jelly</code> <code>flip</code> <code>exploader</code> <code>bouncyflip</code>
|
|
||||||
<br><b>Default value:</b> <code>jelly</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>display_time</code></td>
|
|
||||||
<td>Time a notification is displayed in milliseconds.<br>
|
|
||||||
<br><b>Possible values:</b> <code>int</code>
|
|
||||||
<br><b>Default value:</b> <code>3500</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>position</code></td>
|
|
||||||
<td>Position where the notifications should be displayed.<br>
|
|
||||||
<br><b>Possible values:</b> <code>left</code> <code>center</code> <code>right</code>
|
|
||||||
<br><b>Default value:</b> <code>center</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>welcome_message</code></td>
|
|
||||||
<td>Message shown at startup.<br>
|
|
||||||
<br><b>Possible values:</b> <code>string</code> <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>false</code> (no message at startup)
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
|
|
||||||
## Developer notes
|
## Developer notes
|
||||||
@ -82,83 +43,21 @@ self.sendNotification("SHOW_ALERT", {});
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Notification params
|
### Notification params
|
||||||
<table width="100%">
|
| Option | Description
|
||||||
<!-- why, markdown... -->
|
| --------- | -----------
|
||||||
<thead>
|
| `title` | The title of the notification. <br><br> **Possible values:** `text` or `html`
|
||||||
<tr>
|
| `message` | The message of the notification. <br><br> **Possible values:** `text` or `html`
|
||||||
<th>Option</th>
|
|
||||||
<th width="100%">Description</th>
|
|
||||||
</tr>
|
|
||||||
<thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td><code>title</code></td>
|
|
||||||
<td>The title of the notification.<br>
|
|
||||||
<br><b>Possible values:</b> <code>text</code> or <code>html</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>message</code></td>
|
|
||||||
<td>The message of the notification.<br>
|
|
||||||
<br><b>Possible values:</b> <code>text</code> or <code>html</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
### Alert params
|
### Alert params
|
||||||
<table width="100%">
|
| Option | Description
|
||||||
<!-- why, markdown... -->
|
| ----------------------------------------------- | -----------
|
||||||
<thead>
|
| `title` | The title of the alert. <br><br> **Possible values:** `text` or `html`
|
||||||
<tr>
|
| `message` | The message of the alert. <br><br> **Possible values:** `text` or `html`
|
||||||
<th>Option</th>
|
| `imageUrl` (optional) | Image to show in the alert <br><br> **Possible values:** `url` `path` <br> **Default value:** `none`
|
||||||
<th width="100%">Description</th>
|
| `imageFA` (optional) | Font Awesome icon to show in the alert <br><br> **Possible values:** See [Font Awsome](http://fontawesome.io/icons/) website. <br> **Default value:** `none`
|
||||||
</tr>
|
| `imageHeight` (optional even with imageUrl set) | Height of the image <br><br> **Possible values:** `intpx` <br> **Default value:** `80px`
|
||||||
<thead>
|
| `timer` (optional) | How long the alert should stay visible in ms. <br> **Important:** If you do not use the `timer`, it is your duty to hide the alert by using `self.sendNotification("HIDE_ALERT");`! <br><br>**Possible values:** `int` `float` <br> **Default value:** `none`
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td><code>title</code></td>
|
|
||||||
<td>The title of the alert.<br>
|
|
||||||
<br><b>Possible values:</b> <code>text</code> or <code>html</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>message</code></td>
|
|
||||||
<td>The message of the alert.<br>
|
|
||||||
<br><b>Possible values:</b> <code>text</code> or <code>html</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>imageUrl</code> (optional)</td>
|
|
||||||
<td>Image to show in the alert<br>
|
|
||||||
<br><b>Possible values:</b> <code>url</code> <code>path</code>
|
|
||||||
<br><b>Default value:</b> <code>none</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>imageFA</code> (optional)</td>
|
|
||||||
<td>Font Awesome icon to show in the alert<br>
|
|
||||||
<br><b>Possible values:</b> See <a href="http://fontawesome.io/icons/" target="_blank">Font Awsome</a> website.
|
|
||||||
<br><b>Default value:</b> <code>none</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>imageHeight</code> (optional even with imageUrl set)</td>
|
|
||||||
<td>Height of the image<br>
|
|
||||||
<br><b>Possible values:</b> <code>intpx</code>
|
|
||||||
<br><b>Default value:</b> <code>80px</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>timer</code> (optional)</td>
|
|
||||||
<td>How long the alert should stay visible in ms.
|
|
||||||
<br><b>Important:</b> If you do not use the <code>timer</code>, it is your duty to hide the alert by using <code>self.sendNotification("HIDE_ALERT");</code>!<br>
|
|
||||||
<br><b>Possible values:</b> <code>int</code> <code>float</code>
|
|
||||||
<br><b>Default value:</b> <code>none</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
## Open Source Licenses
|
## Open Source Licenses
|
||||||
###[NotificationStyles](https://github.com/codrops/NotificationStyles)
|
###[NotificationStyles](https://github.com/codrops/NotificationStyles)
|
||||||
|
4
modules/default/alert/translations/hu.json
Normal file
4
modules/default/alert/translations/hu.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"sysTitle": "MagicMirror értesítés",
|
||||||
|
"welcome": "Üdvözöljük, indulás sikeres!"
|
||||||
|
}
|
4
modules/default/alert/translations/ru.json
Normal file
4
modules/default/alert/translations/ru.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"sysTitle": "MagicMirror Уведомление",
|
||||||
|
"welcome": "Добро пожаловать, старт был успешным!""
|
||||||
|
}
|
@ -8,8 +8,8 @@ To use this module, add it to the modules array in the `config/config.js` file:
|
|||||||
````javascript
|
````javascript
|
||||||
modules: [
|
modules: [
|
||||||
{
|
{
|
||||||
module: 'calendar',
|
module: "calendar",
|
||||||
position: 'top_left', // This can be any of the regions. Best results in left or right regions.
|
position: "top_left", // This can be any of the regions. Best results in left or right regions.
|
||||||
config: {
|
config: {
|
||||||
// The config property is optional.
|
// The config property is optional.
|
||||||
// If no config is set, an example calendar is shown.
|
// If no config is set, an example calendar is shown.
|
||||||
@ -24,152 +24,26 @@ modules: [
|
|||||||
The following properties can be configured:
|
The following properties can be configured:
|
||||||
|
|
||||||
|
|
||||||
<table width="100%">
|
| Option | Description
|
||||||
<!-- why, markdown... -->
|
| ---------------------------- | -----------
|
||||||
<thead>
|
| `maximumEntries` | The maximum number of events shown. / **Possible values:** `0` - `100` <br> **Default value:** `10`
|
||||||
<tr>
|
| `maximumNumberOfDays` | The maximum number of days in the future. <br><br> **Default value:** `365`
|
||||||
<th>Option</th>
|
| `displaySymbol` | Display a symbol in front of an entry. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||||
<th width="100%">Description</th>
|
| `defaultSymbol` | The default symbol. <br><br> **Possible values:** See [Font Awsome](http://fontawesome.io/icons/) website. <br> **Default value:** `calendar`
|
||||||
</tr>
|
| `maxTitleLength` | The maximum title length. <br><br> **Possible values:** `10` - `50` <br> **Default value:** `25`
|
||||||
<thead>
|
| `fetchInterval` | How often does the content needs to be fetched? (Milliseconds) <br><br> **Possible values:** `1000` - `86400000` <br> **Default value:** `300000` (5 minutes)
|
||||||
<tbody>
|
| `animationSpeed` | Speed of the update animation. (Milliseconds) <br><br> **Possible values:**`0` - `5000` <br> **Default value:** `2000` (2 seconds)
|
||||||
<tr>
|
| `fade` | Fade the future events to black. (Gradient) <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||||
<td><code>maximumEntries</code></td>
|
| `fadePoint` | Where to start fade? <br><br> **Possible values:** `0` (top of the list) - `1` (bottom of list) <br> **Default value:** `0.25`
|
||||||
<td>The maximum number of events shown.<br>
|
| `calendars` | The list of calendars. <br><br> **Possible values:** An array, see _calendar configuration_ below. <br> **Default value:** _An example calendar._
|
||||||
<br><b>Possible values:</b> <code>0</code> - <code>100</code>
|
| `titleReplace` | An object of textual replacements applied to the tile of the event. This allow to remove or replace certains words in the title. <br><br> **Example:** `{'Birthday of ' : '', 'foo':'bar'}` <br> **Default value:** `{ "De verjaardag van ": "", "'s birthday": "" }`
|
||||||
<br><b>Default value:</b> <code>10</code>
|
| `displayRepeatingCountTitle` | Show count title for yearly repeating events (e.g. "X. Birthday", "X. Anniversary") <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
|
||||||
</td>
|
| `dateFormat` | Format to use for the date of events (when using absolute dates) <br><br> **Possible values:** See [Moment.js formats](http://momentjs.com/docs/#/parsing/string-format/) <br> **Default value:** `MMM Do` (e.g. Jan 18th)
|
||||||
</tr>
|
| `timeFormat` | Display event times as absolute dates, or relative time <br><br> **Possible values:** `absolute` or `relative` <br> **Default value:** `relative`
|
||||||
<tr>
|
| `getRelative` | How much time (in hours) should be left until calendar events start getting relative? <br><br> **Possible values:** `0` (events stay absolute) - `48` (48 hours before the event starts) <br> **Default value:** `6`
|
||||||
<td><code>maximumNumberOfDays</code></td>
|
| `urgency` | When using a timeFormat of `absolute`, the `urgency` setting allows you to display events within a specific time frame as `relative`. This allows events within a certain time frame to be displayed as relative (in xx days) while others are displayed as absolute dates <br><br> **Possible values:** a positive integer representing the number of days for which you want a relative date, for example `7` (for 7 days) <br><br> **Default value:** `7`
|
||||||
<td>The maximum number of days in the future.<br>
|
| `broadcastEvents` | If this property is set to true, the calendar will broadcast all the events to all other modules with the notification message: `CALENDAR_EVENTS`. The event objects are stored in an array and contain the following fields: `title`, `startDate`, `endDate`, `fullDayEvent`, `location` and `geo`. <br><br> **Possible values:** `true`, `false` <br><br> **Default value:** `true`
|
||||||
<br><b>Default value:</b> <code>365</code>
|
| `hidePrivate` | Hides private calendar events. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>displaySymbol</code></td>
|
|
||||||
<td>Display a symbol in front of an entry.<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>true</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>defaultSymbol</code></td>
|
|
||||||
<td>The default symbol.<br>
|
|
||||||
<br><b>Possible values:</b> See <a href="http://fontawesome.io/icons/" target="_blank">Font Awsome</a> website.
|
|
||||||
<br><b>Default value:</b> <code>calendar</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>maxTitleLength</code></td>
|
|
||||||
<td>The maximum title length.<br>
|
|
||||||
<br><b>Possible values:</b> <code>10</code> - <code>50</code>
|
|
||||||
<br><b>Default value:</b> <code>25</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>fetchInterval</code></td>
|
|
||||||
<td>How often does the content needs to be fetched? (Milliseconds)<br>
|
|
||||||
<br><b>Possible values:</b> <code>1000</code> - <code>86400000</code>
|
|
||||||
<br><b>Default value:</b> <code>300000</code> (5 minutes)
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>animationSpeed</code></td>
|
|
||||||
<td>Speed of the update animation. (Milliseconds)<br>
|
|
||||||
<br><b>Possible values:</b><code>0</code> - <code>5000</code>
|
|
||||||
<br><b>Default value:</b> <code>2000</code> (2 seconds)
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>fade</code></td>
|
|
||||||
<td>Fade the future events to black. (Gradient)<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>true</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>fadePoint</code></td>
|
|
||||||
<td>Where to start fade?<br>
|
|
||||||
<br><b>Possible values:</b> <code>0</code> (top of the list) - <code>1</code> (bottom of list)
|
|
||||||
<br><b>Default value:</b> <code>0.25</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>calendars</code></td>
|
|
||||||
<td>The list of calendars.<br>
|
|
||||||
<br><b>Possible values:</b> An array, see <i>calendar configuration</i> below.
|
|
||||||
<br><b>Default value:</b> <i>An example calendar.</i>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>titleReplace</code></td>
|
|
||||||
<td>An object of textual replacements applied to the tile of the event. This allow to remove or replace certains words in the title.<br>
|
|
||||||
<br><b>Example:</b> <br>
|
|
||||||
<code>
|
|
||||||
titleReplace: {'Birthday of ' : '', 'foo':'bar'}
|
|
||||||
</code>
|
|
||||||
<br><b>Default value:</b>
|
|
||||||
<code>
|
|
||||||
{
|
|
||||||
"De verjaardag van ": "",
|
|
||||||
"'s birthday": ""
|
|
||||||
}
|
|
||||||
</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>displayRepeatingCountTitle</code></td>
|
|
||||||
<td>Show count title for yearly repeating events (e.g. "X. Birthday", "X. Anniversary")<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>false</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>dateFormat</code></td>
|
|
||||||
<td>Format to use for the date of events (when using absolute dates)<br>
|
|
||||||
<br><b>Possible values:</b> See <a href="http://momentjs.com/docs/#/parsing/string-format/">Moment.js formats</a>
|
|
||||||
<br><b>Default value:</b> <code>MMM Do</code> (e.g. Jan 18th)
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>timeFormat</code></td>
|
|
||||||
<td>Display event times as absolute dates, or relative time<br>
|
|
||||||
<br><b>Possible values:</b> <code>absolute</code> or <code>relative</code>
|
|
||||||
<br><b>Default value:</b> <code>relative</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>getRelative</code></td>
|
|
||||||
<td>How much time (in hours) should be left until calendar events start getting relative?<br>
|
|
||||||
<br><b>Possible values:</b> <code>0</code> (events stay absolute) - <code>48</code> (48 hours before the event starts)
|
|
||||||
<br><b>Default value:</b> <code>6</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>urgency</code></td>
|
|
||||||
<td>When using a timeFormat of <code>absolute</code>, the <code>urgency</code> setting allows you to display events within a specific time frame as <code>relative</code>
|
|
||||||
This allows events within a certain time frame to be displayed as relative (in xx days) while others are displayed as absolute dates<br>
|
|
||||||
<br><b>Possible values:</b> a positive integer representing the number of days for which you want a relative date, for example <code>7</code> (for 7 days)<br>
|
|
||||||
<br><b>Default value:</b> <code>7</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>broadcastEvents</code></td>
|
|
||||||
<td>If this property is set to true, the calendar will broadcast all the events to all other modules with the notification message: <code>CALENDAR_EVENTS</code>. The event objects are stored in an array and contain the following fields: <code>title</code>, <code>startDate</code>, <code>endDate</code>, <code>fullDayEvent</code>, <code>location</code> and <code>geo</code>.<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code>, <code>false</code> <br>
|
|
||||||
<br><b>Default value:</b> <code>true</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>hidePrivate</code></td>
|
|
||||||
<td>Hides private calendar events.<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>false</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
### Calendar configuration
|
### Calendar configuration
|
||||||
|
|
||||||
@ -179,7 +53,7 @@ The `colored` property gives the option for an individual color for each calenda
|
|||||||
#### Default value:
|
#### Default value:
|
||||||
````javascript
|
````javascript
|
||||||
config: {
|
config: {
|
||||||
colored: false,
|
colored: false,
|
||||||
calendars: [
|
calendars: [
|
||||||
{
|
{
|
||||||
url: 'http://www.calendarlabs.com/templates/ical/US-Holidays.ics',
|
url: 'http://www.calendarlabs.com/templates/ical/US-Holidays.ics',
|
||||||
@ -212,12 +86,13 @@ config: {
|
|||||||
<br><b>Possible values:</b> See <a href="http://fontawesome.io/icons/" target="_blank">Font Awesome</a> website.
|
<br><b>Possible values:</b> See <a href="http://fontawesome.io/icons/" target="_blank">Font Awesome</a> website.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>color</code></td>
|
<td><code>color</code></td>
|
||||||
<td>The font color of an event from this calendar. This property should be set if the config is set to colored: true.<br>
|
<td>The font color of an event from this calendar. This property should be set if the config is set to colored: true.<br>
|
||||||
<br><b>Possible values:</b> HEX, RGB or RGBA values (#efefef, rgb(242,242,242), rgba(242,242,242,0.5)).
|
<br><b>Possible values:</b> HEX, RGB or RGBA values (#efefef, rgb(242,242,242), rgba(242,242,242,0.5)).
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>repeatingCountTitle</code></td>
|
<td><code>repeatingCountTitle</code></td>
|
||||||
<td>The count title for yearly repating events in this calendar. <br>
|
<td>The count title for yearly repating events in this calendar. <br>
|
||||||
|
@ -390,7 +390,7 @@ Module.register("calendar", {
|
|||||||
|
|
||||||
/* capFirst(string)
|
/* capFirst(string)
|
||||||
* Capitalize the first letter of a string
|
* Capitalize the first letter of a string
|
||||||
* Eeturn capitalized string
|
* Return capitalized string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
capFirst: function (string) {
|
capFirst: function (string) {
|
||||||
@ -409,6 +409,13 @@ Module.register("calendar", {
|
|||||||
titleTransform: function (title) {
|
titleTransform: function (title) {
|
||||||
for (var needle in this.config.titleReplace) {
|
for (var needle in this.config.titleReplace) {
|
||||||
var replacement = this.config.titleReplace[needle];
|
var replacement = this.config.titleReplace[needle];
|
||||||
|
|
||||||
|
var regParts = needle.match(/^\/(.+)\/([gim]*)$/);
|
||||||
|
if (regParts) {
|
||||||
|
// the parsed pattern is a regexp.
|
||||||
|
needle = new RegExp(regParts[1], regParts[2]);
|
||||||
|
}
|
||||||
|
|
||||||
title = title.replace(needle, replacement);
|
title = title.replace(needle, replacement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@ var CalendarFetcher = require("./calendarfetcher.js");
|
|||||||
module.exports = NodeHelper.create({
|
module.exports = NodeHelper.create({
|
||||||
// Override start method.
|
// Override start method.
|
||||||
start: function() {
|
start: function() {
|
||||||
var self = this;
|
|
||||||
var events = [];
|
var events = [];
|
||||||
|
|
||||||
this.fetchers = [];
|
this.fetchers = [];
|
||||||
|
12
modules/default/calendar/vendor/ical.js/ical.js
vendored
12
modules/default/calendar/vendor/ical.js/ical.js
vendored
@ -90,7 +90,6 @@
|
|||||||
return dt
|
return dt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var dateParam = function(name){
|
var dateParam = function(name){
|
||||||
return function(val, params, curr){
|
return function(val, params, curr){
|
||||||
|
|
||||||
@ -143,6 +142,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var exdateParam = function(name){
|
||||||
|
return function(val, params, curr){
|
||||||
|
var date = dateParam(name)(val, params, curr);
|
||||||
|
if (date.exdates === undefined) {
|
||||||
|
date.exdates = [];
|
||||||
|
}
|
||||||
|
date.exdates.push(date.exdate);
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var geoParam = function(name){
|
var geoParam = function(name){
|
||||||
return function(val, params, curr){
|
return function(val, params, curr){
|
||||||
@ -240,6 +249,7 @@
|
|||||||
, 'LOCATION' : storeParam('location')
|
, 'LOCATION' : storeParam('location')
|
||||||
, 'DTSTART' : dateParam('start')
|
, 'DTSTART' : dateParam('start')
|
||||||
, 'DTEND' : dateParam('end')
|
, 'DTEND' : dateParam('end')
|
||||||
|
, 'EXDATE' : exdateParam('exdate')
|
||||||
,' CLASS' : storeParam('class')
|
,' CLASS' : storeParam('class')
|
||||||
, 'TRANSP' : storeParam('transparency')
|
, 'TRANSP' : storeParam('transparency')
|
||||||
, 'GEO' : geoParam('geo')
|
, 'GEO' : geoParam('geo')
|
||||||
|
@ -17,7 +17,8 @@ exports.parseFile = function(filename){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var rrule = require('rrule').RRule
|
var rrule = require('rrule-alt').RRule
|
||||||
|
var rrulestr = rrule.rrulestr
|
||||||
|
|
||||||
ical.objectHandlers['RRULE'] = function(val, params, curr, stack, line){
|
ical.objectHandlers['RRULE'] = function(val, params, curr, stack, line){
|
||||||
curr.rrule = line;
|
curr.rrule = line;
|
||||||
@ -26,7 +27,7 @@ ical.objectHandlers['RRULE'] = function(val, params, curr, stack, line){
|
|||||||
var originalEnd = ical.objectHandlers['END'];
|
var originalEnd = ical.objectHandlers['END'];
|
||||||
ical.objectHandlers['END'] = function(val, params, curr, stack){
|
ical.objectHandlers['END'] = function(val, params, curr, stack){
|
||||||
if (curr.rrule) {
|
if (curr.rrule) {
|
||||||
var rule = curr.rrule.replace('RRULE:', '');
|
var rule = curr.rrule;
|
||||||
if (rule.indexOf('DTSTART') === -1) {
|
if (rule.indexOf('DTSTART') === -1) {
|
||||||
|
|
||||||
if (curr.start.length === 8) {
|
if (curr.start.length === 8) {
|
||||||
@ -36,10 +37,14 @@ ical.objectHandlers['END'] = function(val, params, curr, stack){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rule += ';DTSTART=' + curr.start.toISOString().replace(/[-:]/g, '');
|
rule += ' DTSTART:' + curr.start.toISOString().replace(/[-:]/g, '');
|
||||||
rule = rule.replace(/\.[0-9]{3}/, '');
|
rule = rule.replace(/\.[0-9]{3}/, '');
|
||||||
}
|
}
|
||||||
curr.rrule = rrule.fromString(rule);
|
for (var i in curr.exdates) {
|
||||||
|
rule += ' EXDATE:' + curr.exdates[i].toISOString().replace(/[-:]/g, '');
|
||||||
|
rule = rule.replace(/\.[0-9]{3}/, '');
|
||||||
|
}
|
||||||
|
curr.rrule = rrulestr(rule);
|
||||||
}
|
}
|
||||||
return originalEnd.call(this, val, params, curr, stack);
|
return originalEnd.call(this, val, params, curr, stack);
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,8 @@ To use this module, add it to the modules array in the `config/config.js` file:
|
|||||||
````javascript
|
````javascript
|
||||||
modules: [
|
modules: [
|
||||||
{
|
{
|
||||||
module: 'clock',
|
module: "clock",
|
||||||
position: 'top_left', // This can be any of the regions.
|
position: "top_left", // This can be any of the regions.
|
||||||
config: {
|
config: {
|
||||||
// The config property is optional.
|
// The config property is optional.
|
||||||
// See 'Configuration options' for more information.
|
// See 'Configuration options' for more information.
|
||||||
@ -22,106 +22,18 @@ modules: [
|
|||||||
|
|
||||||
The following properties can be configured:
|
The following properties can be configured:
|
||||||
|
|
||||||
<table width="100%">
|
| Option | Description
|
||||||
<!-- why, markdown... -->
|
| ----------------- | -----------
|
||||||
<thead>
|
| `timeFormat` | Use 12 or 24 hour format. <br><br> **Possible values:** `12` or `24` <br> **Default value:** uses value of _config.timeFormat_
|
||||||
<tr>
|
| `displaySeconds` | Display seconds. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||||
<th>Option</th>
|
| `showPeriod` | Show the period (am/pm) with 12 hour format. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||||
<th width="100%">Description</th>
|
| `showPeriodUpper` | Show the period (AM/PM) with 12 hour format as uppercase. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
|
||||||
</tr>
|
| `clockBold` | Remove the colon and bold the minutes to make a more modern look. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
|
||||||
<thead>
|
| `showDate` | Turn off or on the Date section. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||||
<tbody>
|
| `displayType` | Display a digital clock, analog clock, or both together. <br><br> **Possible values:** `digital`, `analog`, or `both` <br> **Default value:** `digital`
|
||||||
<tr>
|
| `analogSize` | **Specific to the analog clock.** Defines how large the analog display is. <br><br> **Possible values:** A positive number of pixels` <br> **Default value:** `200px`
|
||||||
<td><code>timeFormat</code></td>
|
| `analogFace` | **Specific to the analog clock.** Specifies which clock face to use. <br><br> **Possible values:** `simple` for a simple border, `none` for no face or border, or `face-###` (where ### is currently a value between 001 and 012, inclusive) <br> **Default value:** `simple`
|
||||||
<td>Use 12 or 24 hour format.<br>
|
| `secondsColor` | **Specific to the analog clock.** Specifies what color to make the 'seconds' hand. <br><br> **Possible values:** `any HTML RGB Color` <br> **Default value:** `#888888`
|
||||||
<br><b>Possible values:</b> <code>12</code> or <code>24</code>
|
| `analogPlacement` | **Specific to the analog clock. _(requires displayType set to `'both'`)_** Specifies where the analog clock is in relation to the digital clock <br><br> **Possible values:** `top`, `right`, `bottom`, or `left` <br> **Default value:** `bottom`
|
||||||
<br><b>Default value:</b> uses value of <i>config.timeFormat</i>
|
| `analogShowDate` | **Specific to the analog clock.** If the clock is used as a separate module and set to analog only, this configures whether a date is also displayed with the clock. <br><br> **Possible values:** `false`, `top`, or `bottom` <br> **Default value:** `top`
|
||||||
</td>
|
| `timezone` | Specific a timezone to show clock. <br><br> **Possible examples values:** `America/New_York`, `America/Santiago`, `Etc/GMT+10` <br> **Default value:** `none`
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>displaySeconds</code></td>
|
|
||||||
<td>Display seconds.<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>true</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>showPeriod</code></td>
|
|
||||||
<td>Show the period (am/pm) with 12 hour format.<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>true</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>showPeriodUpper</code></td>
|
|
||||||
<td>Show the period (AM/PM) with 12 hour format as uppercase.<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>false</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>clockBold</code></td>
|
|
||||||
<td>Remove the colon and bold the minutes to make a more modern look.<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>false</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>showDate</code></td>
|
|
||||||
<td>Turn off or on the Date section.<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>true</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>displayType</code></td>
|
|
||||||
<td>Display a digital clock, analog clock, or both together.<br>
|
|
||||||
<br><b>Possible values:</b> <code>digital</code>, <code>analog</code>, or <code>both</code>
|
|
||||||
<br><b>Default value:</b> <code>digital</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>analogSize</code></td>
|
|
||||||
<td><strong>Specific to the analog clock.</strong> Defines how large the analog display is.<br>
|
|
||||||
<br><b>Possible values:</b> A positive number of pixels</code>
|
|
||||||
<br><b>Default value:</b> <code>200px</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>analogFace</code></td>
|
|
||||||
<td><strong>Specific to the analog clock.</strong> Specifies which clock face to use.<br>
|
|
||||||
<br><b>Possible values:</b> <code>simple</code> for a simple border, <code>none</code> for no face or border, or <code>face-###</code> (where ### is currently a value between 001 and 012, inclusive)
|
|
||||||
<br><b>Default value:</b> <code>simple</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>secondsColor</code></td>
|
|
||||||
<td><strong>Specific to the analog clock.</strong> Specifies what color to make the 'seconds' hand.<br>
|
|
||||||
<br><b>Possible values:</b> <code>any HTML RGB Color</code>
|
|
||||||
<br><b>Default value:</b> <code>#888888</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>analogPlacement</code></td>
|
|
||||||
<td><strong>Specific to the analog clock. <em>(requires displayType set to <code>'both'</code>)</em></strong> Specifies where the analog clock is in relation to the digital clock<br>
|
|
||||||
<br><b>Possible values:</b> <code>top</code>, <code>right</code>, <code>bottom</code>, or <code>left</code>
|
|
||||||
<br><b>Default value:</b> <code>bottom</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>analogShowDate</code></td>
|
|
||||||
<td><strong>Specific to the analog clock.</strong> If the clock is used as a separate module and set to analog only, this configures whether a date is also displayed with the clock.<br>
|
|
||||||
<br><b>Possible values:</b> <code>false</code>, <code>top</code>, or <code>bottom</code>
|
|
||||||
<br><b>Default value:</b> <code>top</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>timezone</code></td>
|
|
||||||
<td>Specific a timezone to show clock.<br>
|
|
||||||
<br><b>Possible examples values:</b> <code>America/New_York</code>, <code>America/Santiago</code>, <code>Etc/GMT+10</code>
|
|
||||||
<br><b>Default value:</b> <code>none</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
@ -134,6 +134,10 @@ Module.register("clock",{
|
|||||||
if (this.config.analogFace != "" && this.config.analogFace != "simple" && this.config.analogFace != "none") {
|
if (this.config.analogFace != "" && this.config.analogFace != "simple" && this.config.analogFace != "none") {
|
||||||
clockCircle.style.background = "url("+ this.data.path + "faces/" + this.config.analogFace + ".svg)";
|
clockCircle.style.background = "url("+ this.data.path + "faces/" + this.config.analogFace + ".svg)";
|
||||||
clockCircle.style.backgroundSize = "100%";
|
clockCircle.style.backgroundSize = "100%";
|
||||||
|
|
||||||
|
// The following line solves issue: https://github.com/MichMich/MagicMirror/issues/611
|
||||||
|
clockCircle.style.border = "1px solid black";
|
||||||
|
|
||||||
} else if (this.config.analogFace != "none") {
|
} else if (this.config.analogFace != "none") {
|
||||||
clockCircle.style.border = "2px solid white";
|
clockCircle.style.border = "2px solid white";
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,8 @@ To use this module, add it to the modules array in the `config/config.js` file:
|
|||||||
````javascript
|
````javascript
|
||||||
modules: [
|
modules: [
|
||||||
{
|
{
|
||||||
module: 'compliments',
|
module: "compliments",
|
||||||
position: 'lower_third', // This can be any of the regions.
|
position: "lower_third", // This can be any of the regions.
|
||||||
// Best results in one of the middle regions like: lower_third
|
// Best results in one of the middle regions like: lower_third
|
||||||
config: {
|
config: {
|
||||||
// The config property is optional.
|
// The config property is optional.
|
||||||
@ -25,48 +25,12 @@ modules: [
|
|||||||
The following properties can be configured:
|
The following properties can be configured:
|
||||||
|
|
||||||
|
|
||||||
<table width="100%">
|
| Option | Description
|
||||||
<!-- why, markdown... -->
|
| ---------------- | -----------
|
||||||
<thead>
|
| `updateInterval` | How often does the compliment have to change? (Milliseconds) <br><br> **Possible values:** `1000` - `86400000` <br> **Default value:** `30000` (30 seconds)
|
||||||
<tr>
|
| `fadeSpeed` | Speed of the update animation. (Milliseconds) <br><br> **Possible values:**`0` - `5000` <br> **Default value:** `4000` (4 seconds)
|
||||||
<th>Option</th>
|
| `compliments` | The list of compliments. <br><br> **Possible values:** An object with three arrays: `morning`, `afternoon` and`evening`. See _compliment configuration_ below. <br> **Default value:** See _compliment configuration_ below.
|
||||||
<th width="100%">Description</th>
|
| `remoteFile` | External file from which to load the compliments <br><br> **Possible values:** Path to a JSON file containing compliments, configured as per the value of the _compliments configuration_ (see below). An object with three arrays: `morning`, `afternoon` and `evening`. - `compliments.json` <br> **Default value:** `null` (Do not load from file)
|
||||||
</tr>
|
|
||||||
<thead>
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>updateInterval</code></td>
|
|
||||||
<td>How often does the compliment have to change? (Milliseconds)<br>
|
|
||||||
<br><b>Possible values:</b> <code>1000</code> - <code>86400000</code>
|
|
||||||
<br><b>Default value:</b> <code>30000</code> (30 seconds)
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>fadeSpeed</code></td>
|
|
||||||
<td>Speed of the update animation. (Milliseconds)<br>
|
|
||||||
<br><b>Possible values:</b><code>0</code> - <code>5000</code>
|
|
||||||
<br><b>Default value:</b> <code>4000</code> (4 seconds)
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>compliments</code></td>
|
|
||||||
<td>The list of compliments.<br>
|
|
||||||
<br><b>Possible values:</b> An object with three arrays: <code>morning</code>, <code>afternoon</code> and<code>evening</code>. See <i>compliment configuration</i> below.
|
|
||||||
<br><b>Default value:</b> See <i>compliment configuration</i> below.
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>remoteFile</code></td>
|
|
||||||
<td>External file from which to load the compliments<br>
|
|
||||||
<br><b>Possible values:</b>Path to a JSON file containing compliments, configured
|
|
||||||
as per the value of the <i>compliments configuration</i> (see below). An object with three arrays:
|
|
||||||
morning, afternoon and evening. - <code>compliments.json</code>
|
|
||||||
<br><b>Default value:</b> <code>null</code> (Do not load from file)
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
### Compliment configuration
|
### Compliment configuration
|
||||||
|
|
||||||
@ -74,36 +38,36 @@ The `compliments` property contains an object with three arrays: <code>morning</
|
|||||||
|
|
||||||
|
|
||||||
If use the currentweather is possible use a actual weather for set compliments. The availables properties are:
|
If use the currentweather is possible use a actual weather for set compliments. The availables properties are:
|
||||||
* <code>day_sunny</code>
|
* `day_sunny`
|
||||||
* <code>day_cloudy</code>
|
* `day_cloudy`
|
||||||
* <code>cloudy</code>
|
* `cloudy`
|
||||||
* <code>cloudy_windy</code>
|
* `cloudy_windy`
|
||||||
* <code>showers</code>
|
* `showers`
|
||||||
* <code>rain</code>
|
* `rain`
|
||||||
* <code>thunderstorm</code>
|
* `thunderstorm`
|
||||||
* <code>snow</code>
|
* `snow`
|
||||||
* <code>fog</code>
|
* `fog`
|
||||||
* <code>night_clear</code>
|
* `night_clear`
|
||||||
* <code>night_cloudy</code>
|
* `night_cloudy`
|
||||||
* <code>night_showers</code>
|
* `night_showers`
|
||||||
* <code>night_rain</code>
|
* `night_rain`
|
||||||
* <code>night_thunderstorm</code>
|
* `night_thunderstorm`
|
||||||
* <code>night_snow</code>
|
* `night_snow`
|
||||||
* <code>night_alt_cloudy_windy</code>
|
* `night_alt_cloudy_windy`
|
||||||
|
|
||||||
#### Example use with currentweather module
|
#### Example use with currentweather module
|
||||||
````javascript
|
````javascript
|
||||||
config: {
|
config: {
|
||||||
compliments: {
|
compliments: {
|
||||||
day_sunny: [
|
day_sunny: [
|
||||||
'Today is a sunny day',
|
"Today is a sunny day",
|
||||||
'It\'s a beautiful day'
|
"It's a beautiful day"
|
||||||
],
|
],
|
||||||
snow: [
|
snow: [
|
||||||
'Snowball battle!'
|
"Snowball battle!"
|
||||||
],
|
],
|
||||||
rain: [
|
rain: [
|
||||||
'Don\'t forget your umbrella'
|
"Don't forget your umbrella"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -115,19 +79,19 @@ config: {
|
|||||||
config: {
|
config: {
|
||||||
compliments: {
|
compliments: {
|
||||||
morning: [
|
morning: [
|
||||||
'Good morning, handsome!',
|
"Good morning, handsome!",
|
||||||
'Enjoy your day!',
|
"Enjoy your day!",
|
||||||
'How was your sleep?'
|
"How was your sleep?"
|
||||||
],
|
],
|
||||||
afternoon: [
|
afternoon: [
|
||||||
'Hello, beauty!',
|
"Hello, beauty!",
|
||||||
'You look sexy!',
|
'You look sexy!',
|
||||||
'Looking good today!'
|
"Looking good today!"
|
||||||
],
|
],
|
||||||
evening: [
|
evening: [
|
||||||
'Wow, you look hot!',
|
"Wow, you look hot!",
|
||||||
'You look nice!',
|
"You look nice!",
|
||||||
'Hi, sexy!'
|
"Hi, sexy!"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,14 +8,14 @@ To use this module, add it to the modules array in the `config/config.js` file:
|
|||||||
````javascript
|
````javascript
|
||||||
modules: [
|
modules: [
|
||||||
{
|
{
|
||||||
module: 'currentweather',
|
module: "currentweather",
|
||||||
position: 'top_right', // This can be any of the regions.
|
position: "top_right", // This can be any of the regions.
|
||||||
// Best results in left or right regions.
|
// Best results in left or right regions.
|
||||||
config: {
|
config: {
|
||||||
// See 'Configuration options' for more information.
|
// See 'Configuration options' for more information.
|
||||||
location: 'Amsterdam,Netherlands',
|
location: "Amsterdam,Netherlands",
|
||||||
locationID: '', //Location ID from http://openweathermap.org/help/city_list.txt
|
locationID: "", //Location ID from http://openweathermap.org/help/city_list.txt
|
||||||
appid: 'abcde12345abcde12345abcde12345ab' //openweathermap.org API key.
|
appid: "abcde12345abcde12345abcde12345ab" //openweathermap.org API key.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -26,189 +26,52 @@ modules: [
|
|||||||
The following properties can be configured:
|
The following properties can be configured:
|
||||||
|
|
||||||
|
|
||||||
<table width="100%">
|
| Option | Description
|
||||||
<!-- why, markdown... -->
|
| ---------------------------- | -----------
|
||||||
<thead>
|
| `location` | The location used for weather information. <br><br> **Example:** `'Amsterdam,Netherlands'` <br> **Default value:** `false` <br><br> **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.
|
||||||
<tr>
|
| `locationID` | Location ID from [OpenWeatherMap](http://openweathermap.org/help/city_list.txt) **This will override anything you put in location.** <br> Leave blank if you want to use location. <br> **Example:** `1234567` <br> **Default value:** `false` <br><br> **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.
|
||||||
<th>Option</th>
|
| `appid` | The [OpenWeatherMap](https://home.openweathermap.org) API key, which can be obtained by creating an OpenWeatherMap account. <br><br> This value is **REQUIRED**
|
||||||
<th width="100%">Description</th>
|
| `units` | What units to use. Specified by config.js <br><br> **Possible values:** `config.units` = Specified by config.js, `default` = Kelvin, `metric` = Celsius, `imperial` =Fahrenheit <br> **Default value:** `config.units`
|
||||||
</tr>
|
| `roundTemp` | Round temperature value to nearest integer. <br><br> **Possible values:** `true` (round to integer) or `false` (display exact value with decimal point) <br> **Default value:** `false`
|
||||||
<thead>
|
| `updateInterval` | How often does the content needs to be fetched? (Milliseconds) <br><br> **Possible values:** `1000` - `86400000` <br> **Default value:** `600000` (10 minutes)
|
||||||
<tbody>
|
| `animationSpeed` | Speed of the update animation. (Milliseconds) <br><br> **Possible values:**`0` - `5000` <br> **Default value:** `1000` (1 second)
|
||||||
<tr>
|
| `timeFormat` | Use 12 or 24 hour format. <br><br> **Possible values:** `12` or `24` <br> **Default value:** uses value of _config.timeFormat_
|
||||||
<td><code>location</code></td>
|
| `showPeriod` | Show the period (am/pm) with 12 hour format <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||||
<td>The location used for weather information.<br>
|
| `showPeriodUpper` | Show the period (AM/PM) with 12 hour format as uppercase <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
|
||||||
<br><b>Example:</b> <code>'Amsterdam,Netherlands'</code>
|
| `showWindDirection` | Show the wind direction next to the wind speed. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||||
<br><b>Default value:</b> <code>false</code><br><br>
|
| `showHumidity` | Show the current humidity <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
|
||||||
<strong>Note:</strong> When the <code>location</code> and <code>locationID</code> 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.
|
| `onlyTemp` | Show only current Temperature and weather icon. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
|
||||||
</td>
|
| `useBeaufort` | Pick between using the Beaufort scale for wind speed or using the default units. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||||
</tr>
|
| `lang` | The language of the days. <br><br> **Possible values:** `en`, `nl`, `ru`, etc ... <br> **Default value:** uses value of _config.language_
|
||||||
<tr>
|
| `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) <br><br> **Possible values:** `1000` - `5000` <br> **Default value:** `0`
|
||||||
<td><code>locationID</code></td>
|
| `retryDelay` | The delay before retrying after a request failure. (Milliseconds) <br><br> **Possible values:** `1000` - `60000` <br> **Default value:** `2500`
|
||||||
<td>Location ID from <a href="http://openweathermap.org/help/city_list.txt">OpenWeatherMap</a> <b>This will override anything you put in location.</b><br>Leave blank if you want to use location.
|
| `apiVersion` | The OpenWeatherMap API version to use. <br><br> **Default value:** `2.5`
|
||||||
<br><b>Example:</b> <code>1234567</code>
|
| `apiBase` | The OpenWeatherMap base URL. <br><br> **Default value:** `'http://api.openweathermap.org/data/'`
|
||||||
<br><b>Default value:</b> <code>false</code><br><br>
|
| `weatherEndpoint` | The OpenWeatherMap API endPoint. <br><br> **Default value:** `'weather'`
|
||||||
<strong>Note:</strong> When the <code>location</code> and <code>locationID</code> 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.
|
| `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. <br><br> **Default value:** `true`
|
||||||
</td>
|
| `calendarClass` | The class for the calender module to base the event based weather information on. <br><br> **Default value:** `'calendar'`
|
||||||
</tr>
|
| `iconTable` | The conversion table to convert the weather conditions to weather-icons. <br><br> **Default value:** view tabel below.
|
||||||
<tr>
|
|
||||||
<td><code>appid</code></td>
|
#### Default Icon Table
|
||||||
<td>The <a href="https://home.openweathermap.org" target="_blank">OpenWeatherMap</a> API key, which can be obtained by creating an OpenWeatherMap account.<br>
|
````javascript
|
||||||
<br> This value is <b>REQUIRED</b>
|
iconTable: {
|
||||||
</td>
|
'01d': 'wi-day-sunny',
|
||||||
</tr>
|
'02d': 'wi-day-cloudy',
|
||||||
<tr>
|
'03d': 'wi-cloudy',
|
||||||
<td><code>units</code></td>
|
'04d': 'wi-cloudy-windy',
|
||||||
<td>What units to use. Specified by config.js<br>
|
'09d': 'wi-showers',
|
||||||
<br><b>Possible values:</b> <code>config.units</code> = Specified by config.js, <code>default</code> = Kelvin, <code>metric</code> = Celsius, <code>imperial</code> =Fahrenheit
|
'10d': 'wi-rain',
|
||||||
<br><b>Default value:</b> <code>config.units</code>
|
'11d': 'wi-thunderstorm',
|
||||||
</td>
|
'13d': 'wi-snow',
|
||||||
</tr>
|
'50d': 'wi-fog',
|
||||||
<tr>
|
'01n': 'wi-night-clear',
|
||||||
<td><code>roundTemp</code></td>
|
'02n': 'wi-night-cloudy',
|
||||||
<td>Round temperature value to nearest integer.<br>
|
'03n': 'wi-night-cloudy',
|
||||||
<br><b>Possible values:</b> <code>true</code> (round to integer) or <code>false</code> (display exact value with decimal point)
|
'04n': 'wi-night-cloudy',
|
||||||
<br><b>Default value:</b> <code>false</code>
|
'09n': 'wi-night-showers',
|
||||||
</td>
|
'10n': 'wi-night-rain',
|
||||||
</tr>
|
'11n': 'wi-night-thunderstorm',
|
||||||
<tr>
|
'13n': 'wi-night-snow',
|
||||||
<td><code>updateInterval</code></td>
|
'50n': 'wi-night-alt-cloudy-windy'
|
||||||
<td>How often does the content needs to be fetched? (Milliseconds)<br>
|
}
|
||||||
<br><b>Possible values:</b> <code>1000</code> - <code>86400000</code>
|
````
|
||||||
<br><b>Default value:</b> <code>600000</code> (10 minutes)
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>animationSpeed</code></td>
|
|
||||||
<td>Speed of the update animation. (Milliseconds)<br>
|
|
||||||
<br><b>Possible values:</b><code>0</code> - <code>5000</code>
|
|
||||||
<br><b>Default value:</b> <code>1000</code> (1 second)
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>timeFormat</code></td>
|
|
||||||
<td>Use 12 or 24 hour format.<br>
|
|
||||||
<br><b>Possible values:</b> <code>12</code> or <code>24</code>
|
|
||||||
<br><b>Default value:</b> uses value of <i>config.timeFormat</i>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>showPeriod</code></td>
|
|
||||||
<td>Show the period (am/pm) with 12 hour format<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>true</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>showPeriodUpper</code></td>
|
|
||||||
<td>Show the period (AM/PM) with 12 hour format as uppercase<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>false</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>showWindDirection</code></td>
|
|
||||||
<td>Show the wind direction next to the wind speed.<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>true</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>showHumidity</code></td>
|
|
||||||
<td>Show the current humidity<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>false</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>onlyTemp</code></td>
|
|
||||||
<td>Show only current Temperature and weather icon.<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>false</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>useBeaufort</code></td>
|
|
||||||
<td>Pick between using the Beaufort scale for wind speed or using the default units.<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>true</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>lang</code></td>
|
|
||||||
<td>The language of the days.<br>
|
|
||||||
<br><b>Possible values:</b> <code>en</code>, <code>nl</code>, <code>ru</code>, etc ...
|
|
||||||
<br><b>Default value:</b> uses value of <i>config.language</i>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>initialLoadDelay</code></td>
|
|
||||||
<td>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)<br>
|
|
||||||
<br><b>Possible values:</b> <code>1000</code> - <code>5000</code>
|
|
||||||
<br><b>Default value:</b> <code>0</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>retryDelay</code></td>
|
|
||||||
<td>The delay before retrying after a request failure. (Milliseconds)<br>
|
|
||||||
<br><b>Possible values:</b> <code>1000</code> - <code>60000</code>
|
|
||||||
<br><b>Default value:</b> <code>2500</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>apiVersion</code></td>
|
|
||||||
<td>The OpenWeatherMap API version to use.<br>
|
|
||||||
<br><b>Default value:</b> <code>2.5</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>apiBase</code></td>
|
|
||||||
<td>The OpenWeatherMap base URL.<br>
|
|
||||||
<br><b>Default value:</b> <code>'http://api.openweathermap.org/data/'</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>weatherEndpoint</code></td>
|
|
||||||
<td>The OpenWeatherMap API endPoint.<br>
|
|
||||||
<br><b>Default value:</b> <code>'weather'</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>appendLocationNameToHeader</code></td>
|
|
||||||
<td>If set to <code>true</code>, 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.<br>
|
|
||||||
<br><b>Default value:</b> <code>true</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>calendarClass</code></td>
|
|
||||||
<td>The class for the calender module to base the event based weather information on.<br>
|
|
||||||
<br><b>Default value:</b> <code>'calendar'</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>iconTable</code></td>
|
|
||||||
<td>The conversion table to convert the weather conditions to weather-icons.<br>
|
|
||||||
<br><b>Default value:</b> <code>iconTable: {
|
|
||||||
'01d':'wi-day-sunny',
|
|
||||||
'02d':'wi-day-cloudy',
|
|
||||||
'03d':'wi-cloudy',
|
|
||||||
'04d':'wi-cloudy-windy',
|
|
||||||
'09d':'wi-showers',
|
|
||||||
'10d':'wi-rain',
|
|
||||||
'11d':'wi-thunderstorm',
|
|
||||||
'13d':'wi-snow',
|
|
||||||
'50d':'wi-fog',
|
|
||||||
'01n':'wi-night-clear',
|
|
||||||
'02n':'wi-night-cloudy',
|
|
||||||
'03n':'wi-night-cloudy',
|
|
||||||
'04n':'wi-night-cloudy',
|
|
||||||
'09n':'wi-night-showers',
|
|
||||||
'10n':'wi-night-rain',
|
|
||||||
'11n':'wi-night-thunderstorm',
|
|
||||||
'13n':'wi-night-snow',
|
|
||||||
'50n':'wi-night-alt-cloudy-windy'
|
|
||||||
}</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
@ -296,7 +296,7 @@ Module.register("currentweather",{
|
|||||||
*/
|
*/
|
||||||
processWeather: function(data) {
|
processWeather: function(data) {
|
||||||
|
|
||||||
if (!data || !data.main || !data.main.temp) {
|
if (!data || !data.main || typeof data.main.temp === "undefined") {
|
||||||
// Did not receive usable new data.
|
// Did not receive usable new data.
|
||||||
// Maybe this needs a better check?
|
// Maybe this needs a better check?
|
||||||
return;
|
return;
|
||||||
|
@ -6,11 +6,11 @@ To use this module, add it to the modules array in the `config/config.js` file:
|
|||||||
````javascript
|
````javascript
|
||||||
modules: [
|
modules: [
|
||||||
{
|
{
|
||||||
module: 'helloworld',
|
module: "helloworld",
|
||||||
position: 'bottom_bar', // This can be any of the regions.
|
position: "bottom_bar", // This can be any of the regions.
|
||||||
config: {
|
config: {
|
||||||
// See 'Configuration options' for more information.
|
// See 'Configuration options' for more information.
|
||||||
text: 'Hello world!'
|
text: "Hello world!"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -20,23 +20,6 @@ modules: [
|
|||||||
|
|
||||||
The following properties can be configured:
|
The following properties can be configured:
|
||||||
|
|
||||||
|
| Option | Description
|
||||||
<table width="100%">
|
| ------ | -----------
|
||||||
<!-- why, markdown... -->
|
| `text` | The text to display. <br><br> **Example:** `'Hello world!'` <br> **Default value:** `'Hello world!'`
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Option</th>
|
|
||||||
<th width="100%">Description</th>
|
|
||||||
</tr>
|
|
||||||
<thead>
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>text</code></td>
|
|
||||||
<td>The text to display.<br>
|
|
||||||
<br><b>Example:</b> <code>'Hello world!'</code>
|
|
||||||
<br><b>Default value:</b> <code>'Hello world!'</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
# Module: News Feed
|
# Module: News Feed
|
||||||
The `newsfeed ` module is one of the default modules of the MagicMirror.
|
The `newsfeed ` module is one of the default modules of the MagicMirror.
|
||||||
This module displays news headlines based on an RSS feed.
|
This module displays news headlines based on an RSS feed. Scrolling through news headlines happens time-based (````updateInterval````), but can also be controlled by sending news feed specific notifications to the module.
|
||||||
|
|
||||||
## Using the module
|
## Using the module
|
||||||
|
|
||||||
|
### Configuration
|
||||||
To use this module, add it to the modules array in the `config/config.js` file:
|
To use this module, add it to the modules array in the `config/config.js` file:
|
||||||
````javascript
|
````javascript
|
||||||
modules: [
|
modules: [
|
||||||
{
|
{
|
||||||
module: 'newsfeed',
|
module: "newsfeed",
|
||||||
position: 'bottom_bar', // This can be any of the regions. Best results in center regions.
|
position: "bottom_bar", // This can be any of the regions. Best results in center regions.
|
||||||
config: {
|
config: {
|
||||||
// The config property is optional.
|
// The config property is optional.
|
||||||
// If no config is set, an example calendar is shown.
|
// If no config is set, an example calendar is shown.
|
||||||
@ -30,152 +31,51 @@ modules: [
|
|||||||
]
|
]
|
||||||
````
|
````
|
||||||
|
|
||||||
|
### Notifications
|
||||||
|
#### Interacting with the module
|
||||||
|
MagicMirror's [notification mechanism](https://github.com/MichMich/MagicMirror/tree/master/modules#thissendnotificationnotification-payload) allows to send notifications to the `newsfeed` module. The following notifications are supported:
|
||||||
|
|
||||||
|
| Notification Identifier | Description
|
||||||
|
| ----------------------- | -----------
|
||||||
|
| `ARTICLE_NEXT` | Shows the next news title (hiding the summary or previously fully displayed article)
|
||||||
|
| `ARTICLE_PREVIOUS` | Shows the previous news title (hiding the summary or previously fully displayed article)
|
||||||
|
| `ARTICLE_MORE_DETAILS` | When received the _first time_, shows the corresponding description of the currently displayed news title. <br> The module expects that the module's configuration option `showDescription` is set to `false` (default value). <br><br> When received a _second consecutive time_, shows the full news article in an IFRAME. <br> 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`.
|
||||||
|
| `ARTICLE_LESS_DETAILS` | Hides the summary or full news article and only displays the news title of the currently viewed news item.
|
||||||
|
|
||||||
|
Note the payload of the sent notification event is ignored.
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
The following example shows how the next news article title can be displayed on the MagicMirror.
|
||||||
|
````javascript
|
||||||
|
this.sendNotification('ARTICLE_NEXT');
|
||||||
|
````
|
||||||
|
|
||||||
|
#### `newsfeed` specific notification emitting modules
|
||||||
|
The third party [MMM-Gestures](https://github.com/thobach/MMM-Gestures) module supports above notifications when moving your hand up, down, left or right in front of a gesture sensor attached to the MagicMirror. See module's readme for more details.
|
||||||
|
|
||||||
## Configuration options
|
## Configuration options
|
||||||
|
|
||||||
The following properties can be configured:
|
The following properties can be configured:
|
||||||
|
|
||||||
|
| Option | Description
|
||||||
<table width="100%">
|
| ----------------- | -----------
|
||||||
<!-- why, markdown... -->
|
| `feeds` | An array of feed urls that will be used as source. <br> More info about this object can be found below. <br> **Default value:** `[{ title: "New York Times", url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml", encoding: "UTF-8" }]`
|
||||||
<thead>
|
| `showSourceTitle` | Display the title of the source. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||||
<tr>
|
| `showPublishDate` | Display the publish date of an headline. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||||
<th>Option</th>
|
| `showDescription` | Display the description of an item. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
|
||||||
<th width="100%">Description</th>
|
| `reloadInterval` | How often does the content needs to be fetched? (Milliseconds) <br><br> **Possible values:** `1000` - `86400000` <br> **Default value:** `300000` (5 minutes)
|
||||||
</tr>
|
| `updateInterval` | How often do you want to display a new headline? (Milliseconds) <br><br> **Possible values:**`1000` - `60000` <br> **Default value:** `10000` (10 seconds)
|
||||||
<thead>
|
| `animationSpeed` | Speed of the update animation. (Milliseconds) <br><br> **Possible values:**`0` - `5000` <br> **Default value:** `2500` (2.5 seconds)
|
||||||
<tbody>
|
| `maxNewsItems` | Total amount of news items to cycle through. (0 for unlimited) <br><br> **Possible values:**`0` - `...` <br> **Default value:** `0`
|
||||||
|
| `removeStartTags` | Some newsfeeds feature tags at the **beginning** of their titles or descriptions, such as _[VIDEO]_. This setting allows for the removal of specified tags from the beginning of an item's description and/or title. <br><br> **Possible values:**`'title'`, `'description'`, `'both'`
|
||||||
<tr>
|
| `startTags` | List the tags you would like to have removed at the beginning of the feed item <br><br> **Possible values:** `['TAG']` or `['TAG1','TAG2',...]`
|
||||||
<td><code>feeds</code></td>
|
| `removeEndTags` | Remove specified tags from the **end** of an item's description and/or title. <br><br> **Possible values:**`'title'`, `'description'`, `'both'`
|
||||||
<td>An array of feed urls that will be used as source.<br>
|
| `endTags` | List the tags you would like to have removed at the end of the feed item <br><br> **Possible values:** `['TAG']` or `['TAG1','TAG2',...]`
|
||||||
More info about this object can be found below.
|
|
||||||
<br><b>Default value:</b> <code>[
|
|
||||||
{
|
|
||||||
title: "New York Times",
|
|
||||||
url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml",
|
|
||||||
encoding: "UTF-8"
|
|
||||||
}
|
|
||||||
]</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>showSourceTitle</code></td>
|
|
||||||
<td>Display the title of the source.<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>true</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>showPublishDate</code></td>
|
|
||||||
<td>Display the publish date of an headline.<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>true</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>showDescription</code></td>
|
|
||||||
<td>Display the description of an item.<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>false</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>reloadInterval</code></td>
|
|
||||||
<td>How often does the content needs to be fetched? (Milliseconds)<br>
|
|
||||||
<br><b>Possible values:</b> <code>1000</code> - <code>86400000</code>
|
|
||||||
<br><b>Default value:</b> <code>300000</code> (5 minutes)
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>updateInterval</code></td>
|
|
||||||
<td>How often do you want to display a new headline? (Milliseconds)<br>
|
|
||||||
<br><b>Possible values:</b><code>1000</code> - <code>60000</code>
|
|
||||||
<br><b>Default value:</b> <code>10000</code> (10 seconds)
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>animationSpeed</code></td>
|
|
||||||
<td>Speed of the update animation. (Milliseconds)<br>
|
|
||||||
<br><b>Possible values:</b><code>0</code> - <code>5000</code>
|
|
||||||
<br><b>Default value:</b> <code>2500</code> (2.5 seconds)
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>maxNewsItems</code></td>
|
|
||||||
<td>Total amount of news items to cycle through. (0 for unlimited)<br>
|
|
||||||
<br><b>Possible values:</b><code>0</code> - <code>...</code>
|
|
||||||
<br><b>Default value:</b> <code>0</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
removeStartTags: false,
|
|
||||||
removeEndTags: false,
|
|
||||||
startTags: [],
|
|
||||||
endTags: []
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>removeStartTags</code></td>
|
|
||||||
<td>Some newsfeeds feature tags at the <B>beginning</B> of their titles or descriptions, such as <em>[VIDEO]</em>.
|
|
||||||
This setting allows for the removal of specified tags from the beginning of an item's description and/or title.<br>
|
|
||||||
<br><b>Possible values:</b><code>'title'</code>, <code>'description'</code>, <code>'both'</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>startTags</code></td>
|
|
||||||
<td>List the tags you would like to have removed at the beginning of the feed item<br>
|
|
||||||
<br><b>Possible values:</b> <code>['TAG']</code> or <code>['TAG1','TAG2',...]</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>removeEndTags</code></td>
|
|
||||||
<td>Remove specified tags from the <B>end</B> of an item's description and/or title.<br>
|
|
||||||
<br><b>Possible values:</b><code>'title'</code>, <code>'description'</code>, <code>'both'</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>endTags</code></td>
|
|
||||||
<td>List the tags you would like to have removed at the end of the feed item<br>
|
|
||||||
<br><b>Possible values:</b> <code>['TAG']</code> or <code>['TAG1','TAG2',...]</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
The `feeds` property contains an array with multiple objects. These objects have the following properties:
|
The `feeds` property contains an array with multiple objects. These objects have the following properties:
|
||||||
|
|
||||||
<table width="100%">
|
| Option | Description
|
||||||
<!-- why, markdown... -->
|
| ---------- | -----------
|
||||||
<thead>
|
| `title` | The name of the feed source to be displayed above the news items. <br><br> This property is optional.
|
||||||
<tr>
|
| `url` | The url of the feed used for the headlines. <br><br> **Example:** `'http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml'`
|
||||||
<th>Option</th>
|
| `encoding` | The encoding of the news feed. <br><br> This property is optional. <br> **Possible values:**`'UTF-8'`, `'ISO-8859-1'`, etc ... <br> **Default value:** `'UTF-8'`
|
||||||
<th width="100%">Description</th>
|
|
||||||
</tr>
|
|
||||||
<thead>
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>title</code></td>
|
|
||||||
<td>The name of the feed source to be displayed above the news items.<br>
|
|
||||||
<br>This property is optional.
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><code>url</code></td>
|
|
||||||
<td>The url of the feed used for the headlines.<br>
|
|
||||||
<br><b>Example:</b> <code>'http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml'</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>encoding</code></td>
|
|
||||||
<td>The encoding of the news feed.<br>
|
|
||||||
<br>This property is optional.
|
|
||||||
<br><b>Possible values:</b><code>'UTF-8'</code>, <code>'ISO-8859-1'</code>, etc ...
|
|
||||||
<br><b>Default value:</b> <code>'UTF-8'</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
@ -85,7 +85,12 @@ var Fetcher = function(url, reloadInterval, encoding) {
|
|||||||
nodeVersion = Number(process.version.match(/^v(\d+\.\d+)/)[1]);
|
nodeVersion = Number(process.version.match(/^v(\d+\.\d+)/)[1]);
|
||||||
headers = {"User-Agent": "Mozilla/5.0 (Node.js "+ nodeVersion + ") MagicMirror/" + global.version + " (https://github.com/MichMich/MagicMirror/)"}
|
headers = {"User-Agent": "Mozilla/5.0 (Node.js "+ nodeVersion + ") MagicMirror/" + global.version + " (https://github.com/MichMich/MagicMirror/)"}
|
||||||
|
|
||||||
request({uri: url, encoding: null, headers: headers}).pipe(iconv.decodeStream(encoding)).pipe(parser);
|
request({uri: url, encoding: null, headers: headers})
|
||||||
|
.on("error", function(error) {
|
||||||
|
fetchFailedCallback(self, error);
|
||||||
|
scheduleTimer();
|
||||||
|
})
|
||||||
|
.pipe(iconv.decodeStream(encoding)).pipe(parser);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -89,7 +89,8 @@ Module.register("newsfeed",{
|
|||||||
|
|
||||||
if (this.newsItems.length > 0) {
|
if (this.newsItems.length > 0) {
|
||||||
|
|
||||||
if (this.config.showSourceTitle || this.config.showPublishDate) {
|
// this.config.showFullArticle is a run-time configuration, triggered by optional notifications
|
||||||
|
if (!this.config.showFullArticle && (this.config.showSourceTitle || this.config.showPublishDate)) {
|
||||||
var sourceAndTimestamp = document.createElement("div");
|
var sourceAndTimestamp = document.createElement("div");
|
||||||
sourceAndTimestamp.className = "light small dimmed";
|
sourceAndTimestamp.className = "light small dimmed";
|
||||||
|
|
||||||
@ -152,10 +153,12 @@ Module.register("newsfeed",{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var title = document.createElement("div");
|
if(!this.config.showFullArticle){
|
||||||
title.className = "bright medium light";
|
var title = document.createElement("div");
|
||||||
title.innerHTML = this.newsItems[this.activeItem].title;
|
title.className = "bright medium light";
|
||||||
wrapper.appendChild(title);
|
title.innerHTML = this.newsItems[this.activeItem].title;
|
||||||
|
wrapper.appendChild(title);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.config.showDescription) {
|
if (this.config.showDescription) {
|
||||||
var description = document.createElement("div");
|
var description = document.createElement("div");
|
||||||
@ -164,6 +167,21 @@ Module.register("newsfeed",{
|
|||||||
wrapper.appendChild(description);
|
wrapper.appendChild(description);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.config.showFullArticle) {
|
||||||
|
var fullArticle = document.createElement("iframe");
|
||||||
|
fullArticle.className = "";
|
||||||
|
fullArticle.style.width = "100%";
|
||||||
|
fullArticle.style.top = "0";
|
||||||
|
fullArticle.style.left = "0";
|
||||||
|
fullArticle.style.position = "fixed";
|
||||||
|
fullArticle.height = window.innerHeight;
|
||||||
|
fullArticle.style.border = "none";
|
||||||
|
fullArticle.src = this.newsItems[this.activeItem].url;
|
||||||
|
wrapper.appendChild(fullArticle);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
wrapper.innerHTML = this.translate("LOADING");
|
wrapper.innerHTML = this.translate("LOADING");
|
||||||
wrapper.className = "small dimmed";
|
wrapper.className = "small dimmed";
|
||||||
@ -256,7 +274,7 @@ Module.register("newsfeed",{
|
|||||||
|
|
||||||
self.updateDom(self.config.animationSpeed);
|
self.updateDom(self.config.animationSpeed);
|
||||||
|
|
||||||
setInterval(function() {
|
timer = setInterval(function() {
|
||||||
self.activeItem++;
|
self.activeItem++;
|
||||||
self.updateDom(self.config.animationSpeed);
|
self.updateDom(self.config.animationSpeed);
|
||||||
}, this.config.updateInterval);
|
}, this.config.updateInterval);
|
||||||
@ -273,5 +291,50 @@ Module.register("newsfeed",{
|
|||||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
resetDescrOrFullArticleAndTimer: function() {
|
||||||
|
this.config.showDescription = false;
|
||||||
|
this.config.showFullArticle = false;
|
||||||
|
if(!timer){
|
||||||
|
this.scheduleUpdateInterval();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
notificationReceived: function(notification, payload, sender) {
|
||||||
|
Log.info(this.name + " - received notification: " + notification);
|
||||||
|
if(notification == "ARTICLE_NEXT"){
|
||||||
|
var before = this.activeItem;
|
||||||
|
this.activeItem++;
|
||||||
|
if (this.activeItem >= this.newsItems.length) {
|
||||||
|
this.activeItem = 0;
|
||||||
|
}
|
||||||
|
this.resetDescrOrFullArticleAndTimer();
|
||||||
|
Log.info(this.name + " - going from article #" + before + " to #" + this.activeItem + " (of " + this.newsItems.length + ")");
|
||||||
|
this.updateDom(100);
|
||||||
|
} else if(notification == "ARTICLE_PREVIOUS"){
|
||||||
|
var before = this.activeItem;
|
||||||
|
this.activeItem--;
|
||||||
|
if (this.activeItem < 0) {
|
||||||
|
this.activeItem = this.newsItems.length - 1;
|
||||||
|
}
|
||||||
|
this.resetDescrOrFullArticleAndTimer();
|
||||||
|
Log.info(this.name + " - going from article #" + before + " to #" + this.activeItem + " (of " + this.newsItems.length + ")");
|
||||||
|
this.updateDom(100);
|
||||||
|
}
|
||||||
|
// if "more details" is received the first time: show article summary, on second time show full article
|
||||||
|
else if(notification == "ARTICLE_MORE_DETAILS"){
|
||||||
|
this.config.showDescription = !this.config.showDescription;
|
||||||
|
this.config.showFullArticle = !this.config.showDescription;
|
||||||
|
clearInterval(timer);
|
||||||
|
timer = null;
|
||||||
|
Log.info(this.name + " - showing " + this.config.showDescription ? "article description" : "full article");
|
||||||
|
this.updateDom(100);
|
||||||
|
} else if(notification == "ARTICLE_LESS_DETAILS"){
|
||||||
|
this.resetDescrOrFullArticleAndTimer();
|
||||||
|
Log.info(this.name + " - showing only article titles again");
|
||||||
|
this.updateDom(100);
|
||||||
|
} else {
|
||||||
|
Log.info(this.name + " - unknown notification, ignoring: " + notification);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -8,8 +8,8 @@ To use this module, add it to the modules array in the `config/config.js` file:
|
|||||||
````javascript
|
````javascript
|
||||||
modules: [
|
modules: [
|
||||||
{
|
{
|
||||||
module: 'updatenotification',
|
module: "updatenotification",
|
||||||
position: 'top_center', // This can be any of the regions.
|
position: "top_center", // This can be any of the regions.
|
||||||
config: {
|
config: {
|
||||||
// The config property is optional.
|
// The config property is optional.
|
||||||
// See 'Configuration options' for more information.
|
// See 'Configuration options' for more information.
|
||||||
@ -22,21 +22,6 @@ modules: [
|
|||||||
|
|
||||||
The following properties can be configured:
|
The following properties can be configured:
|
||||||
|
|
||||||
<table width="100%">
|
| Option | Description
|
||||||
<!-- why, markdown... -->
|
| ---------------- | -----------
|
||||||
<thead>
|
| `updateInterval` | How often do you want to check for a new version? This value represents the interval in milliseconds. <br><br> **Possible values:** Any value above `60000` (1 minute) <br> **Default value:** `600000` (10 minutes);
|
||||||
<tr>
|
|
||||||
<th>Option</th>
|
|
||||||
<th width="100%">Description</th>
|
|
||||||
</tr>
|
|
||||||
<thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td><code>updateInterval</code></td>
|
|
||||||
<td>How often do you want to check for a new version? This value represents the interval in milliseconds.<br>
|
|
||||||
<br><b>Possible values:</b> Any value above <code>60000</code> (1 minute);
|
|
||||||
<br><b>Default value:</b> <code>600000</code> (10 minutes);
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
@ -8,14 +8,14 @@ To use this module, add it to the modules array in the `config/config.js` file:
|
|||||||
````javascript
|
````javascript
|
||||||
modules: [
|
modules: [
|
||||||
{
|
{
|
||||||
module: 'weatherforecast',
|
module: "weatherforecast",
|
||||||
position: 'top_right', // This can be any of the regions.
|
position: "top_right", // This can be any of the regions.
|
||||||
// Best results in left or right regions.
|
// Best results in left or right regions.
|
||||||
config: {
|
config: {
|
||||||
// See 'Configuration options' for more information.
|
// See 'Configuration options' for more information.
|
||||||
location: 'Amsterdam,Netherlands',
|
location: "Amsterdam,Netherlands",
|
||||||
locationID: '', //Location ID from http://openweathermap.org/help/city_list.txt
|
locationID: "", //Location ID from http://openweathermap.org/help/city_list.txt
|
||||||
appid: 'abcde12345abcde12345abcde12345ab' //openweathermap.org API key.
|
appid: "abcde12345abcde12345abcde12345ab" //openweathermap.org API key.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -25,177 +25,50 @@ modules: [
|
|||||||
|
|
||||||
The following properties can be configured:
|
The following properties can be configured:
|
||||||
|
|
||||||
|
| Option | Description
|
||||||
|
| ---------------------------- | -----------
|
||||||
|
| `location` | The location used for weather information. <br><br> **Example:** `'Amsterdam,Netherlands'` <br> **Default value:** `false` <br><br> **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.
|
||||||
|
| `locationID` | Location ID from [OpenWeatherMap](http://openweathermap.org/help/city_list.txt) **This will override anything you put in location.** <br> Leave blank if you want to use location. <br> **Example:** `1234567` <br> **Default value:** `false` <br><br> **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.
|
||||||
|
| `appid` | The [OpenWeatherMap](https://home.openweathermap.org) API key, which can be obtained by creating an OpenWeatherMap account. <br><br> This value is **REQUIRED**
|
||||||
|
| `units` | What units to use. Specified by config.js <br><br> **Possible values:** `config.units` = Specified by config.js, `default` = Kelvin, `metric` = Celsius, `imperial` =Fahrenheit <br> **Default value:** `config.units`
|
||||||
|
| `roundTemp` | Round temperature values to nearest integer. <br><br> **Possible values:** `true` (round to integer) or `false` (display exact value with decimal point) <br> **Default value:** `false`
|
||||||
|
| `maxNumberOfDays` | How many days of forecast to return. Specified by config.js <br><br> **Possible values:** `1` - `16` <br> **Default value:** `7` (7 days) <br> This value is optional. By default the weatherforecast module will return 7 days.
|
||||||
|
| `showRainAmount` | Should the predicted rain amount be displayed? <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false` <br> This value is optional. By default the weatherforecast module will not display the predicted amount of rain.
|
||||||
|
| `updateInterval` | How often does the content needs to be fetched? (Milliseconds) <br><br> **Possible values:** `1000` - `86400000` <br> **Default value:** `600000` (10 minutes)
|
||||||
|
| `animationSpeed` | Speed of the update animation. (Milliseconds) <br><br> **Possible values:**`0` - `5000` <br> **Default value:** `1000` (1 second)
|
||||||
|
| `lang` | The language of the days. <br><br> **Possible values:** `en`, `nl`, `ru`, etc ... <br> **Default value:** uses value of _config.language_
|
||||||
|
| `fade` | Fade the future events to black. (Gradient) <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||||
|
| `fadePoint` | Where to start fade? <br><br> **Possible values:** `0` (top of the list) - `1` (bottom of list) <br> **Default value:** `0.25`
|
||||||
|
| `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) <br><br> **Possible values:** `1000` - `5000` <br> **Default value:** `2500` (2.5 seconds delay. This delay is used to keep the OpenWeather API happy.)
|
||||||
|
| `retryDelay` | The delay before retrying after a request failure. (Milliseconds) <br><br> **Possible values:** `1000` - `60000` <br> **Default value:** `2500`
|
||||||
|
| `apiVersion` | The OpenWeatherMap API version to use. <br><br> **Default value:** `2.5`
|
||||||
|
| `apiBase` | The OpenWeatherMap base URL. <br><br> **Default value:** `'http://api.openweathermap.org/data/'`
|
||||||
|
| `forecastEndpoint` | The OpenWeatherMap API endPoint. <br><br> **Default value:** `'forecast/daily'`
|
||||||
|
| `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. <br><br> **Default value:** `true`
|
||||||
|
| `calendarClass` | The class for the calender module to base the event based weather information on. <br><br> **Default value:** `'calendar'`
|
||||||
|
| `iconTable` | The conversion table to convert the weather conditions to weather-icons. <br><br> **Default value:** view table below
|
||||||
|
`colored` | If set 'colored' to true the min-temp get a blue tone and the max-temp get a red tone. <br><br> **Default value:** `'false'`
|
||||||
|
|
||||||
<table width="100%">
|
#### Default Icon Table
|
||||||
<!-- why, markdown... -->
|
````javascript
|
||||||
<thead>
|
iconTable: {
|
||||||
<tr>
|
'01d': 'wi-day-sunny',
|
||||||
<th>Option</th>
|
'02d': 'wi-day-cloudy',
|
||||||
<th width="100%">Description</th>
|
'03d': 'wi-cloudy',
|
||||||
</tr>
|
'04d': 'wi-cloudy-windy',
|
||||||
<thead>
|
'09d': 'wi-showers',
|
||||||
<tbody>
|
'10d': 'wi-rain',
|
||||||
<tr>
|
'11d': 'wi-thunderstorm',
|
||||||
<td><code>location</code></td>
|
'13d': 'wi-snow',
|
||||||
<td>The location used for weather information.<br>
|
'50d': 'wi-fog',
|
||||||
<br><b>Example:</b> <code>'Amsterdam,Netherlands'</code>
|
'01n': 'wi-night-clear',
|
||||||
<br><b>Default value:</b> <code>false</code><br><br>
|
'02n': 'wi-night-cloudy',
|
||||||
<strong>Note:</strong> When the <code>location</code> and <code>locationID</code> 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.
|
'03n': 'wi-night-cloudy',
|
||||||
</td>
|
'04n': 'wi-night-cloudy',
|
||||||
</tr>
|
'09n': 'wi-night-showers',
|
||||||
<tr>
|
'10n': 'wi-night-rain',
|
||||||
<td><code>locationID</code></td>
|
'11n': 'wi-night-thunderstorm',
|
||||||
<td>Location ID from <a href="http://openweathermap.org/help/city_list.txt">OpenWeatherMap</a> <b>This will override anything you put in location.</b><br>Leave blank if you want to use location.
|
'13n': 'wi-night-snow',
|
||||||
<br><b>Example:</b> <code>1234567</code>
|
'50n': 'wi-night-alt-cloudy-windy'
|
||||||
<br><b>Default value:</b> <code>false</code><br><br>
|
}
|
||||||
<strong>Note:</strong> When the <code>location</code> and <code>locationID</code> 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.
|
````
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>appid</code></td>
|
|
||||||
<td>The <a href="https://home.openweathermap.org" target="_blank">OpenWeatherMap</a> API key, which can be obtained by creating an OpenWeatherMap account.<br>
|
|
||||||
<br> This value is <b>REQUIRED</b>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>units</code></td>
|
|
||||||
<td>What units to use. Specified by config.js<br>
|
|
||||||
<br><b>Possible values:</b> <code>config.units</code> = Specified by config.js, <code>default</code> = Kelvin, <code>metric</code> = Celsius, <code>imperial</code> =Fahrenheit
|
|
||||||
<br><b>Default value:</b> <code>config.units</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>roundTemp</code></td>
|
|
||||||
<td>Round temperature values to nearest integer.<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> (round to integer) or <code>false</code> (display exact value with decimal point)
|
|
||||||
<br><b>Default value:</b> <code>false</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>maxNumberOfDays</code></td>
|
|
||||||
<td>How many days of forecast to return. Specified by config.js<br>
|
|
||||||
<br><b>Possible values:</b> <code>1</code> - <code>16</code>
|
|
||||||
<br><b>Default value:</b> <code>7</code> (7 days)
|
|
||||||
<br>This value is optional. By default the weatherforecast module will return 7 days.
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>showRainAmount</code></td>
|
|
||||||
<td>Should the predicted rain amount be displayed?<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>false</code>
|
|
||||||
<br>This value is optional. By default the weatherforecast module will not display the predicted amount of rain.
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>updateInterval</code></td>
|
|
||||||
<td>How often does the content needs to be fetched? (Milliseconds)<br>
|
|
||||||
<br><b>Possible values:</b> <code>1000</code> - <code>86400000</code>
|
|
||||||
<br><b>Default value:</b> <code>600000</code> (10 minutes)
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>animationSpeed</code></td>
|
|
||||||
<td>Speed of the update animation. (Milliseconds)<br>
|
|
||||||
<br><b>Possible values:</b><code>0</code> - <code>5000</code>
|
|
||||||
<br><b>Default value:</b> <code>1000</code> (1 second)
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>lang</code></td>
|
|
||||||
<td>The language of the days.<br>
|
|
||||||
<br><b>Possible values:</b> <code>en</code>, <code>nl</code>, <code>ru</code>, etc ...
|
|
||||||
<br><b>Default value:</b> uses value of <i>config.language</i>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>fade</code></td>
|
|
||||||
<td>Fade the future events to black. (Gradient)<br>
|
|
||||||
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
|
||||||
<br><b>Default value:</b> <code>true</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>fadePoint</code></td>
|
|
||||||
<td>Where to start fade?<br>
|
|
||||||
<br><b>Possible values:</b> <code>0</code> (top of the list) - <code>1</code> (bottom of list)
|
|
||||||
<br><b>Default value:</b> <code>0.25</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>initialLoadDelay</code></td>
|
|
||||||
<td>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)<br>
|
|
||||||
<br><b>Possible values:</b> <code>1000</code> - <code>5000</code>
|
|
||||||
<br><b>Default value:</b> <code>2500</code> (2.5 seconds delay. This delay is used to keep the OpenWeather API happy.)
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>retryDelay</code></td>
|
|
||||||
<td>The delay before retrying after a request failure. (Milliseconds)<br>
|
|
||||||
<br><b>Possible values:</b> <code>1000</code> - <code>60000</code>
|
|
||||||
<br><b>Default value:</b> <code>2500</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>apiVersion</code></td>
|
|
||||||
<td>The OpenWeatherMap API version to use.<br>
|
|
||||||
<br><b>Default value:</b> <code>2.5</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>apiBase</code></td>
|
|
||||||
<td>The OpenWeatherMap base URL.<br>
|
|
||||||
<br><b>Default value:</b> <code>'http://api.openweathermap.org/data/'</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>forecastEndpoint</code></td>
|
|
||||||
<td>The OpenWeatherMap API endPoint.<br>
|
|
||||||
<br><b>Default value:</b> <code>'forecast/daily'</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>appendLocationNameToHeader</code></td>
|
|
||||||
<td>If set to <code>true</code>, 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.<br>
|
|
||||||
<br><b>Default value:</b> <code>true</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>calendarClass</code></td>
|
|
||||||
<td>The class for the calender module to base the event based weather information on.<br>
|
|
||||||
<br><b>Default value:</b> <code>'calendar'</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>iconTable</code></td>
|
|
||||||
<td>The conversion table to convert the weather conditions to weather-icons.<br>
|
|
||||||
<br><b>Default value:</b> <code>iconTable: {
|
|
||||||
'01d':'wi-day-sunny',
|
|
||||||
'02d':'wi-day-cloudy',
|
|
||||||
'03d':'wi-cloudy',
|
|
||||||
'04d':'wi-cloudy-windy',
|
|
||||||
'09d':'wi-showers',
|
|
||||||
'10d':'wi-rain',
|
|
||||||
'11d':'wi-thunderstorm',
|
|
||||||
'13d':'wi-snow',
|
|
||||||
'50d':'wi-fog',
|
|
||||||
'01n':'wi-night-clear',
|
|
||||||
'02n':'wi-night-cloudy',
|
|
||||||
'03n':'wi-night-cloudy',
|
|
||||||
'04n':'wi-night-cloudy',
|
|
||||||
'09n':'wi-night-showers',
|
|
||||||
'10n':'wi-night-rain',
|
|
||||||
'11n':'wi-night-thunderstorm',
|
|
||||||
'13n':'wi-night-snow',
|
|
||||||
'50n':'wi-night-alt-cloudy-windy'
|
|
||||||
}</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><code>colored</code></td>
|
|
||||||
<td>If set 'colored' to true the min-temp get a blue tone and the max-temp get a red tone.<br>
|
|
||||||
<br><b>Default value:</b> <code>false</code>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
@ -154,7 +154,11 @@ Module.register("weatherforecast",{
|
|||||||
if (isNaN(forecast.rain)) {
|
if (isNaN(forecast.rain)) {
|
||||||
rainCell.innerHTML = "";
|
rainCell.innerHTML = "";
|
||||||
} else {
|
} else {
|
||||||
rainCell.innerHTML = forecast.rain + " mm";
|
if(config.units !== "imperial") {
|
||||||
|
rainCell.innerHTML = forecast.rain + " mm";
|
||||||
|
} else {
|
||||||
|
rainCell.innerHTML = (parseFloat(forecast.rain) / 25.4).toFixed(2) + " in";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
rainCell.className = "align-right bright rain";
|
rainCell.className = "align-right bright rain";
|
||||||
row.appendChild(rainCell);
|
row.appendChild(rainCell);
|
||||||
|
5
modules/node_modules/node_helper/index.js
generated
vendored
5
modules/node_modules/node_helper/index.js
generated
vendored
@ -14,6 +14,11 @@ NodeHelper = Class.extend({
|
|||||||
console.log("Initializing new module helper ...");
|
console.log("Initializing new module helper ...");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
loaded: function(callback) {
|
||||||
|
console.log("Module helper loaded: " + this.name);
|
||||||
|
callback();
|
||||||
|
},
|
||||||
|
|
||||||
start: function() {
|
start: function() {
|
||||||
console.log("Staring module helper: " + this.name);
|
console.log("Staring module helper: " + this.name);
|
||||||
},
|
},
|
||||||
|
10
package.json
10
package.json
@ -1,10 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "magicmirror",
|
"name": "magicmirror",
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"description": "A modular interface for smart mirrors.",
|
"description": "A modular interface for smart mirrors.",
|
||||||
"main": "js/electron.js",
|
"main": "js/electron.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "electron js/electron.js"
|
"start": "sh run-start.sh",
|
||||||
|
"postinstall": "sh installers/postinstall/postinstall.sh",
|
||||||
|
"test": "./node_modules/mocha/bin/mocha tests --recursive"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -26,12 +28,14 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/MichMich/MagicMirror#readme",
|
"homepage": "https://github.com/MichMich/MagicMirror#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"chai": "^3.5.0",
|
||||||
"grunt": "latest",
|
"grunt": "latest",
|
||||||
"grunt-eslint": "latest",
|
"grunt-eslint": "latest",
|
||||||
"grunt-jsonlint": "latest",
|
"grunt-jsonlint": "latest",
|
||||||
"grunt-markdownlint": "^1.0.13",
|
"grunt-markdownlint": "^1.0.13",
|
||||||
"grunt-stylelint": "latest",
|
"grunt-stylelint": "latest",
|
||||||
"grunt-yamllint": "latest",
|
"grunt-yamllint": "latest",
|
||||||
|
"mocha": "^3.2.0",
|
||||||
"stylelint-config-standard": "latest",
|
"stylelint-config-standard": "latest",
|
||||||
"time-grunt": "latest"
|
"time-grunt": "latest"
|
||||||
},
|
},
|
||||||
@ -44,7 +48,7 @@
|
|||||||
"iconv-lite": "latest",
|
"iconv-lite": "latest",
|
||||||
"moment": "latest",
|
"moment": "latest",
|
||||||
"request": "^2.78.0",
|
"request": "^2.78.0",
|
||||||
"rrule": "latest",
|
"rrule-alt": "^2.2.3",
|
||||||
"simple-git": "^1.62.0",
|
"simple-git": "^1.62.0",
|
||||||
"socket.io": "^1.5.1",
|
"socket.io": "^1.5.1",
|
||||||
"valid-url": "latest",
|
"valid-url": "latest",
|
||||||
|
4
run-start.sh
Normal file
4
run-start.sh
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
if [ -z "$DISPLAY" ]; then #If not set DISPLAY is SSH remote or tty
|
||||||
|
export DISPLAY=:0 # Set by defaul display
|
||||||
|
fi
|
||||||
|
electron js/electron.js
|
Binary file not shown.
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 36 KiB |
20
tests/functions/compare-version.js
Normal file
20
tests/functions/compare-version.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
var chai = require("chai");
|
||||||
|
var expect = chai.expect;
|
||||||
|
var classMM = require("../../js/class.js"); // require for load module.js
|
||||||
|
var moduleMM = require("../../js/module.js")
|
||||||
|
|
||||||
|
describe("Test function cmpVersions in js/module.js", function() {
|
||||||
|
|
||||||
|
it("should return -1 when comparing 2.1 to 2.2", function() {
|
||||||
|
expect(moduleMM._test.cmpVersions("2.1", "2.2")).to.equal(-1);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should be return 0 when comparing 2.2 to 2.2", function() {
|
||||||
|
expect(moduleMM._test.cmpVersions("2.2", "2.2")).to.equal(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should be return 1 when comparing 1.1 to 1.0", function() {
|
||||||
|
expect(moduleMM._test.cmpVersions("1.1", "1.0")).to.equal(1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
25
tests/global_vars/root_path.js
Normal file
25
tests/global_vars/root_path.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
var fs = require("fs");
|
||||||
|
var path = require("path");
|
||||||
|
var chai = require("chai");
|
||||||
|
var expect = chai.expect;
|
||||||
|
|
||||||
|
describe("Test global.root_path, set in js/app.js", function() {
|
||||||
|
var appMM = require("../../js/app.js")
|
||||||
|
|
||||||
|
var expectedSubPaths = [
|
||||||
|
"modules",
|
||||||
|
"serveronly",
|
||||||
|
"js",
|
||||||
|
"js/app.js",
|
||||||
|
"js/main.js",
|
||||||
|
"js/electron.js",
|
||||||
|
"config"
|
||||||
|
];
|
||||||
|
|
||||||
|
expectedSubPaths.forEach(subpath => {
|
||||||
|
it(`should contain a file/folder "${subpath}"`, function() {
|
||||||
|
expect(fs.existsSync(path.join(global.root_path, subpath))).to.equal(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
34
translations/af.json
Normal file
34
translations/af.json
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
/* GENERAL */
|
||||||
|
"LOADING": "Besig om te laai …",
|
||||||
|
|
||||||
|
/* CALENDAR */
|
||||||
|
"TODAY": "Vandag",
|
||||||
|
"TOMORROW": "Môre",
|
||||||
|
"DAYAFTERTOMORROW": "Oormôre",
|
||||||
|
"RUNNING": "Eindig in",
|
||||||
|
"EMPTY": "Geen komende gebeurtenisse.",
|
||||||
|
|
||||||
|
/* WEATHER */
|
||||||
|
"N": "N",
|
||||||
|
"NNE": "NNO",
|
||||||
|
"NE": "NO",
|
||||||
|
"ENE": "ONO",
|
||||||
|
"E": "O",
|
||||||
|
"ESE": "OSO",
|
||||||
|
"SE": "SO",
|
||||||
|
"SSE": "SSO",
|
||||||
|
"S": "S",
|
||||||
|
"SSW": "SSW",
|
||||||
|
"SW": "SW",
|
||||||
|
"WSW": "WSW",
|
||||||
|
"W": "W",
|
||||||
|
"WNW": "WNW",
|
||||||
|
"NW": "NW",
|
||||||
|
"NNW": "NNW",
|
||||||
|
|
||||||
|
/* UPDATE INFO */
|
||||||
|
"UPDATE_NOTIFICATION": "MagicMirror² update beskikbaar.",
|
||||||
|
"UPDATE_NOTIFICATION_MODULE": "Update beskikbaar vir MODULE_NAME module.",
|
||||||
|
"UPDATE_INFO": "Die huidige installasie is COMMIT_COUNT agter op die BRANCH_NAME branch."
|
||||||
|
}
|
@ -25,7 +25,7 @@
|
|||||||
"W": "V",
|
"W": "V",
|
||||||
"WNW": "VNV",
|
"WNW": "VNV",
|
||||||
"NW": "NV",
|
"NW": "NV",
|
||||||
"NNW": "NNV"
|
"NNW": "NNV",
|
||||||
|
|
||||||
|
|
||||||
/* UPDATE INFO */
|
/* UPDATE INFO */
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
/* CALENDAR */
|
/* CALENDAR */
|
||||||
"TODAY": "Tänään",
|
"TODAY": "Tänään",
|
||||||
"TOMORROW": "Huomenna",
|
"TOMORROW": "Huomenna",
|
||||||
|
"DAYAFTERTOMORROW": "Ylihuomenna",
|
||||||
"RUNNING": "Meneillään",
|
"RUNNING": "Meneillään",
|
||||||
"EMPTY": "Ei tulevia tapahtumia.",
|
"EMPTY": "Ei tulevia tapahtumia.",
|
||||||
|
|
||||||
@ -24,5 +25,9 @@
|
|||||||
"W": "L",
|
"W": "L",
|
||||||
"WNW": "LPL",
|
"WNW": "LPL",
|
||||||
"NW": "PL",
|
"NW": "PL",
|
||||||
"NNW": "PPL"
|
"NNW": "PPL",
|
||||||
|
|
||||||
|
/* UPDATE INFO */
|
||||||
|
"UPDATE_NOTIFICATION": "MagicMirror² päivitys saatavilla.",
|
||||||
|
"UPDATE_NOTIFICATION_MODULE": "Päivitys saatavilla moduulille MODULE_NAME."
|
||||||
}
|
}
|
||||||
|
34
translations/hu.json
Normal file
34
translations/hu.json
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
/* GENERAL */
|
||||||
|
"LOADING": "Betöltés …",
|
||||||
|
|
||||||
|
/* CALENDAR */
|
||||||
|
"TODAY": "Ma",
|
||||||
|
"TOMORROW": "Holnap",
|
||||||
|
"DAYAFTERTOMORROW": "Holnapután",
|
||||||
|
"RUNNING": "Vége lesz",
|
||||||
|
"EMPTY": "Nincs közelgő esemény.",
|
||||||
|
|
||||||
|
/* WEATHER */
|
||||||
|
"N": "É",
|
||||||
|
"NNE": "ÉÉK",
|
||||||
|
"NE": "ÉK",
|
||||||
|
"ENE": "KÉK",
|
||||||
|
"E": "K",
|
||||||
|
"ESE": "KDK",
|
||||||
|
"SE": "DK",
|
||||||
|
"SSE": "DDK",
|
||||||
|
"S": "D",
|
||||||
|
"SSW": "DDNy",
|
||||||
|
"SW": "DNy",
|
||||||
|
"WSW": "NyDNy",
|
||||||
|
"W": "Ny",
|
||||||
|
"WNW": "NyÉNy",
|
||||||
|
"NW": "ÉNy",
|
||||||
|
"NNW": "ÉÉNy",
|
||||||
|
|
||||||
|
/* UPDATE INFO */
|
||||||
|
"UPDATE_NOTIFICATION": "MagicMirror² elérhető egy frissítés!",
|
||||||
|
"UPDATE_NOTIFICATION_MODULE": "A frissítés MODULE_NAME modul néven érhető el.",
|
||||||
|
"UPDATE_INFO": "A jelenlegi telepítés COMMIT_COUNT mögött BRANCH_NAME ágon található."
|
||||||
|
}
|
34
translations/is.json
Normal file
34
translations/is.json
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
/* GENERAL */
|
||||||
|
"LOADING": "Hleð upp …",
|
||||||
|
|
||||||
|
/* CALENDAR */
|
||||||
|
"TODAY": "Í dag",
|
||||||
|
"TOMORROW": "Á morgun",
|
||||||
|
"DAYAFTERTOMORROW": "Ekki á morgun, heldur hinn",
|
||||||
|
"RUNNING": "Endar eftir",
|
||||||
|
"EMPTY": "Ekkert framundan.",
|
||||||
|
|
||||||
|
/* WEATHER */
|
||||||
|
"N": "N",
|
||||||
|
"NNE": "NNA",
|
||||||
|
"NE": "NA",
|
||||||
|
"ENE": "ANA",
|
||||||
|
"E": "A",
|
||||||
|
"ESE": "ASA",
|
||||||
|
"SE": "SA",
|
||||||
|
"SSE": "SSA",
|
||||||
|
"S": "S",
|
||||||
|
"SSW": "SSV",
|
||||||
|
"SW": "SV",
|
||||||
|
"WSW": "VSV",
|
||||||
|
"W": "V",
|
||||||
|
"WNW": "VNV",
|
||||||
|
"NW": "NV",
|
||||||
|
"NNW": "NNV",
|
||||||
|
|
||||||
|
/* UPDATE INFO */
|
||||||
|
"UPDATE_NOTIFICATION": "MagicMirror² uppfærsla í boði.",
|
||||||
|
"UPDATE_NOTIFICATION_MODULE": "Uppfærsla í boði fyrir MODULE_NAME module.",
|
||||||
|
"UPDATE_INFO": "Núverandi kerfi er COMMIT_COUNT á eftir BRANCH_NAME branchinu."
|
||||||
|
}
|
@ -24,10 +24,10 @@
|
|||||||
"W": "W",
|
"W": "W",
|
||||||
"WNW": "WNW",
|
"WNW": "WNW",
|
||||||
"NW": "NW",
|
"NW": "NW",
|
||||||
"NNW": "NNW"
|
"NNW": "NNW",
|
||||||
|
|
||||||
/* UPDATE INFO */
|
/* UPDATE INFO */
|
||||||
"UPDATE_NOTIFICATION": "Dostępna jest aktualizacja MagicMirror².",
|
"UPDATE_NOTIFICATION": "Dostępna jest aktualizacja MagicMirror².",
|
||||||
"UPDATE_NOTIFICATION_MODULE": "Dostępna jest aktualizacja modułu MODULE_NAME.",
|
"UPDATE_NOTIFICATION_MODULE": "Dostępna jest aktualizacja modułu MODULE_NAME.",
|
||||||
"UPDATE_INFO": "The current installation is COMMIT_COUNT behind on the BRANCH_NAME branch."
|
"UPDATE_INFO": "Zainstalowana wersja odbiega o COMMIT_COUNT commitów od gałęzi BRANCH_NAME."
|
||||||
}
|
}
|
||||||
|
34
translations/ru.json
Normal file
34
translations/ru.json
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
/* GENERAL */
|
||||||
|
"LOADING": "Загрузка …",
|
||||||
|
|
||||||
|
/* CALENDAR */
|
||||||
|
"TODAY": "Сегодня",
|
||||||
|
"TOMORROW": "Завтра",
|
||||||
|
"DAYAFTERTOMORROW": "Послезавтра",
|
||||||
|
"RUNNING": "Заканчивается через",
|
||||||
|
"EMPTY": "Нет предстоящих событий",
|
||||||
|
|
||||||
|
/* WEATHER */
|
||||||
|
"N": "С",
|
||||||
|
"NNE": "ССВ",
|
||||||
|
"NE": "СВ",
|
||||||
|
"ENE": "ВСВ",
|
||||||
|
"E": "В",
|
||||||
|
"ESE": "ВЮВ",
|
||||||
|
"SE": "ЮВ",
|
||||||
|
"SSE": "ЮЮВ",
|
||||||
|
"S": "Ю",
|
||||||
|
"SSW": "ЮЮЗ",
|
||||||
|
"SW": "ЮЗ",
|
||||||
|
"WSW": "ЗЮЗ",
|
||||||
|
"W": "З",
|
||||||
|
"WNW": "ЗСЗ",
|
||||||
|
"NW": "СЗ",
|
||||||
|
"NNW": "ССЗ",
|
||||||
|
|
||||||
|
/* UPDATE INFO */
|
||||||
|
"UPDATE_NOTIFICATION": "Есть обновление для MagicMirror².",
|
||||||
|
"UPDATE_NOTIFICATION_MODULE": "Есть обновление для MODULE_NAME модуля.",
|
||||||
|
"UPDATE_INFO": "Данная инсталляция позади BRANCH_NAME ветки на COMMIT_COUNT коммитов."
|
||||||
|
}
|
@ -26,4 +26,8 @@ var translations = {
|
|||||||
"gr" : "translations/gr.json", // Greek
|
"gr" : "translations/gr.json", // Greek
|
||||||
"da" : "translations/da.json", // Danish
|
"da" : "translations/da.json", // Danish
|
||||||
"tr" : "translations/tr.json", // Turkish
|
"tr" : "translations/tr.json", // Turkish
|
||||||
|
"ru" : "translations/ru.json", // Russian
|
||||||
|
"af" : "translations/af.json", // Afrikaans
|
||||||
|
"hu" : "translations/hu.json", // Hungarian
|
||||||
|
"is" : "translations/is.json", // Icelandic
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user