mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Merge pull request #12 from MichMich/v2-beta
Update V2 beta from master
This commit is contained in:
commit
af0ea4d555
10
.gitignore
vendored
10
.gitignore
vendored
@ -3,11 +3,5 @@
|
||||
!/modules/node_helper
|
||||
!/modules/node_helper/**
|
||||
|
||||
/modules/*
|
||||
!/modules/calendar
|
||||
!/modules/clock
|
||||
!/modules/compliments
|
||||
!/modules/currentweather
|
||||
!/modules/helloworld
|
||||
!/modules/newsfeed
|
||||
!/modules/weatherforecast
|
||||
/modules/**
|
||||
!/modules/default/**
|
||||
|
14
README.md
14
README.md
@ -24,13 +24,13 @@ Things that still have to be implemented or changed.
|
||||
##Modules
|
||||
|
||||
### Default modules:
|
||||
- **Clock**
|
||||
- **Calendar**
|
||||
- **Current Weather**
|
||||
- **Weather Forecast**
|
||||
- **News Feed**
|
||||
- **Compliments**
|
||||
- **Hello World**
|
||||
- [**Clock**](modules/default/clock)
|
||||
- [**Calendar**](modules/default/calendar)
|
||||
- [**Current Weather**](modules/default/currentweather)
|
||||
- [**Weather Forecast**](modules/default/weatherforecast)
|
||||
- [**News Feed**](modules/default/newsfeed)
|
||||
- [**Compliments**](modules/default/compliments)
|
||||
- [**Hello World**](modules/default/helloworld)
|
||||
|
||||
### 3rd Party Modules:
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
<script type="text/javascript" src="js/defaults.js"></script>
|
||||
<script type="text/javascript" src="config/config.js"></script>
|
||||
<script type="text/javascript" src="vendor/vendor.js"></script>
|
||||
<script type="text/javascript" src="modules/default/defaultmodules.js"></script>
|
||||
<script type="text/javascript" src="js/logger.js"></script>
|
||||
<script type="text/javascript" src="js/class.js"></script>
|
||||
<script type="text/javascript" src="js/module.js"></script>
|
||||
|
@ -6,7 +6,7 @@ const fs = require('fs');
|
||||
const Server = require(__dirname + '/server.js');
|
||||
const spawn = require('child_process').spawn;
|
||||
const electron = require('electron');
|
||||
|
||||
const defaultModules = require(__dirname + '/../modules/default/defaultmodules.js');
|
||||
|
||||
// Config
|
||||
var config = {};
|
||||
@ -56,8 +56,18 @@ function loadConfig (callback) {
|
||||
}
|
||||
}
|
||||
|
||||
function loadModule(moduleName) {
|
||||
var helperPath = __dirname + '/../modules/' + moduleName + '/node_helper.js';
|
||||
function loadModule(module) {
|
||||
|
||||
var elements = module.split('/');
|
||||
var moduleName = elements[elements.length - 1];
|
||||
var moduleFolder = __dirname + '/../modules/' + module;
|
||||
|
||||
if (defaultModules.indexOf(moduleName) !== -1) {
|
||||
moduleFolder = __dirname + '/../modules/default/' + module;
|
||||
}
|
||||
|
||||
var helperPath = moduleFolder + '/node_helper.js';
|
||||
|
||||
var loadModule = true;
|
||||
try {
|
||||
fs.accessSync(helperPath, fs.R_OK);
|
||||
|
14
js/loader.js
14
js/loader.js
@ -79,12 +79,20 @@ var Loader = (function() {
|
||||
var moduleData = modules[m];
|
||||
var module = moduleData.module;
|
||||
|
||||
var elements = module.split('/');
|
||||
var moduleName = elements[elements.length - 1];
|
||||
var moduleFolder = config.paths.modules + '/' + module;
|
||||
|
||||
if (defaultModules.indexOf(moduleName) !== -1) {
|
||||
moduleFolder = config.paths.modules + '/default/' + module;
|
||||
}
|
||||
|
||||
moduleFiles.push({
|
||||
index: m,
|
||||
identifier: 'module_' + m + '_' + module,
|
||||
name: module,
|
||||
path: config.paths.modules + '/' + module,
|
||||
file: module + '.js',
|
||||
name: moduleName,
|
||||
path: moduleFolder + '/' ,
|
||||
file: moduleName + '.js',
|
||||
position: moduleData.position,
|
||||
header: moduleData.header,
|
||||
config: moduleData.config,
|
||||
|
@ -49,7 +49,7 @@ var MM = (function() {
|
||||
|
||||
|
||||
|
||||
updateDom(module, 500);
|
||||
updateDom(module, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
152
modules/default/calendar/README.md
Normal file
152
modules/default/calendar/README.md
Normal file
@ -0,0 +1,152 @@
|
||||
# Module: Calendar
|
||||
The `calendar` module is one of the default modules of the MagicMirror.
|
||||
This module displays events from a public .ical calendar. It can combine multiple calendars.
|
||||
|
||||
## Using the module
|
||||
|
||||
To use this module, add it to the modules array in the `config/config.js` file:
|
||||
````javascript
|
||||
modules: [
|
||||
{
|
||||
module: 'calendar',
|
||||
position: 'top_left', // This can be any of the regions. Best results in left or right regions.
|
||||
config: {
|
||||
// The config property is optional.
|
||||
// If no config is set, an example calendar is shown.
|
||||
// See 'Configuration options' for more information.
|
||||
}
|
||||
}
|
||||
]
|
||||
````
|
||||
|
||||
## Configuration options
|
||||
|
||||
The following properties can be configured:
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<!-- why, markdown... -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
<th width="100%">Description</th>
|
||||
</tr>
|
||||
<thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>maximumEntries</code></td>
|
||||
<td>The maximum number of events shown.<br>
|
||||
<br><b>Possible values:</b> <code>0</code> - <code>100</code>
|
||||
<br><b>Default value:</b> <code>10</code>
|
||||
</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>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### Calendar configuration
|
||||
|
||||
The `calendars` property contains an array of the configured calendars.
|
||||
|
||||
#### Default value:
|
||||
````javascript
|
||||
config: {
|
||||
calendars: [
|
||||
{
|
||||
url: 'http://www.calendarlabs.com/templates/ical/US-Holidays.ics',
|
||||
symbol: 'calendar',
|
||||
},
|
||||
],
|
||||
}
|
||||
````
|
||||
|
||||
|
||||
#### Calendar configuration options:
|
||||
<table width="100%">
|
||||
<!-- why, markdown... -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
<th width="100%">Description</th>
|
||||
</tr>
|
||||
<thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>url</code></td>
|
||||
<td>The url of the calendar .ical. This property is required.<br>
|
||||
<br><b>Possible values:</b> Any public accessble .ical calendar.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code> symbol </code></td>
|
||||
<td>The symbol to show in front of an event. This property is optional.<br>
|
||||
<br><b>Possible values:</b> See <a href="http://fontawesome.io/icons/" target="_blank">Font Awsome</a> website.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
49
modules/default/clock/README.md
Normal file
49
modules/default/clock/README.md
Normal file
@ -0,0 +1,49 @@
|
||||
# Module: Clock
|
||||
The `clock` module is one of the default modules of the MagicMirror.
|
||||
This module displays the current date and time. The information will be updated realtime.
|
||||
|
||||
## Using the module
|
||||
|
||||
To use this module, add it to the modules array in the `config/config.js` file:
|
||||
````javascript
|
||||
modules: [
|
||||
{
|
||||
module: 'clock',
|
||||
position: 'top_left', // This can be any of the regions.
|
||||
config: {
|
||||
// The config property is optional.
|
||||
// See 'Configuration options' for more information.
|
||||
}
|
||||
}
|
||||
]
|
||||
````
|
||||
|
||||
## Configuration options
|
||||
|
||||
The following properties can be configured:
|
||||
|
||||
<table width="100%">
|
||||
<!-- why, markdown... -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
<th width="100%">Description</th>
|
||||
</tr>
|
||||
<thead>
|
||||
<tbody>
|
||||
<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>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>
|
||||
</tbody>
|
||||
</table>
|
87
modules/default/compliments/README.md
Normal file
87
modules/default/compliments/README.md
Normal file
@ -0,0 +1,87 @@
|
||||
# Module: Compliments
|
||||
The `compliments` module is one of the default modules of the MagicMirror.
|
||||
This module displays a random compliment.
|
||||
|
||||
## Using the module
|
||||
|
||||
To use this module, add it to the modules array in the `config/config.js` file:
|
||||
````javascript
|
||||
modules: [
|
||||
{
|
||||
module: 'compliments',
|
||||
position: 'lower_third', // This can be any of the regions.
|
||||
// Best results in one of the middle regions like: lower_third
|
||||
config: {
|
||||
// The config property is optional.
|
||||
// If no config is set, an example calendar is shown.
|
||||
// See 'Configuration options' for more information.
|
||||
}
|
||||
}
|
||||
]
|
||||
````
|
||||
|
||||
## Configuration options
|
||||
|
||||
The following properties can be configured:
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<!-- why, markdown... -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
<th width="100%">Description</th>
|
||||
</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>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### Compliment configuration
|
||||
|
||||
The `compliments` property contains an object with three arrays: <code>morning</code>, <code>afternoon</code> and<code>evening</code>. Based on the time of the day, the compliments will be picked out of one of these arrays. The arrays contain one or multiple compliments.
|
||||
|
||||
#### Default value:
|
||||
````javascript
|
||||
config: {
|
||||
compliments: {
|
||||
morning: [
|
||||
'Good morning, handsome!',
|
||||
'Enjoy your day!',
|
||||
'How was your sleep?'
|
||||
],
|
||||
afternoon: [
|
||||
'Hello, beauty!',
|
||||
'You look sexy!',
|
||||
'Looking good today!'
|
||||
],
|
||||
evening: [
|
||||
'Wow, you look hot!',
|
||||
'You look nice!',
|
||||
'Hi, sexy!'
|
||||
]
|
||||
}
|
||||
}
|
||||
````
|
145
modules/default/currentweather/README.md
Normal file
145
modules/default/currentweather/README.md
Normal file
@ -0,0 +1,145 @@
|
||||
# Module: Current Weather
|
||||
The `currentweather` module is one of the default modules of the MagicMirror.
|
||||
This module displays the current weather, including the windspeed, the sunset or sunrise time, the temperature and an icon to display the current conditions.
|
||||
|
||||
## Using the module
|
||||
|
||||
To use this module, add it to the modules array in the `config/config.js` file:
|
||||
````javascript
|
||||
modules: [
|
||||
{
|
||||
module: 'currentweather',
|
||||
position: 'top_right', // This can be any of the regions.
|
||||
// Best results in left or right regions.
|
||||
config: {
|
||||
// See 'Configuration options' for more information.
|
||||
location: 'Amsterdam,Netherlands',
|
||||
appid: 'abcde12345abcde12345abcde12345ab' //openweathermap.org API key.
|
||||
}
|
||||
}
|
||||
]
|
||||
````
|
||||
|
||||
## Configuration options
|
||||
|
||||
The following properties can be configured:
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<!-- why, markdown... -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
<th width="100%">Description</th>
|
||||
</tr>
|
||||
<thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td><code>location</code></td>
|
||||
<td>The location used for weather information.<br>
|
||||
<br><b>Example:</b> <code>Amsterdam,Netherlands</code>
|
||||
<br><b>Default value:</b> <code>New York</code>
|
||||
</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?<br>
|
||||
<br><b>Possible values:</b> <code>default</code> = Kelvin, <code>metric</code> = Celsius, <code>imperial</code> =Fahrenheit
|
||||
<br><b>Default value:</b> <code>metric</code>
|
||||
</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>300000</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>2000</code> (2 seconds)
|
||||
</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>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>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>
|
22
modules/default/defaultmodules.js
Normal file
22
modules/default/defaultmodules.js
Normal file
@ -0,0 +1,22 @@
|
||||
/* Magic Mirror
|
||||
* Default Modules List
|
||||
*
|
||||
* By Michael Teeuw http://michaelteeuw.nl
|
||||
* MIT Licensed.
|
||||
*/
|
||||
|
||||
// Modules listed below can be loaded without the 'default/' prefix. Omitting the default folder name.
|
||||
|
||||
var defaultModules = [
|
||||
'calendar',
|
||||
'clock',
|
||||
'compliments',
|
||||
'currentweather',
|
||||
'helloworld',
|
||||
'newsfeed',
|
||||
'weatherforecast'
|
||||
];
|
||||
|
||||
|
||||
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||
if (typeof module !== 'undefined') {module.exports = defaultModules;}
|
51
modules/default/helloworld/README.md
Normal file
51
modules/default/helloworld/README.md
Normal file
@ -0,0 +1,51 @@
|
||||
# Module: Hello World
|
||||
The `helloworld` module is one of the default modules of the MagicMirror. It is a simple way to display a static text on the mirror.
|
||||
## Using the module
|
||||
|
||||
To use this module, add it to the modules array in the `config/config.js` file:
|
||||
````javascript
|
||||
modules: [
|
||||
{
|
||||
module: 'helloworld',
|
||||
position: 'bottom_bar', // This can be any of the regions.
|
||||
config: {
|
||||
// See 'Configuration options' for more information.
|
||||
text: 'Hello world!',
|
||||
}
|
||||
}
|
||||
]
|
||||
````
|
||||
|
||||
## Configuration options
|
||||
|
||||
The following properties can be configured:
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<!-- why, markdown... -->
|
||||
<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>
|
||||
<tr>
|
||||
<td><code>classes</code></td>
|
||||
<td>Classes to apply to the text.<br>
|
||||
<br><b>Example:</b> <code>'xsmall bold'</code>
|
||||
<br><b>Default value:</b> <code>'normal medium'</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
76
modules/default/newsfeed/README.md
Normal file
76
modules/default/newsfeed/README.md
Normal file
@ -0,0 +1,76 @@
|
||||
# Module: News Feed
|
||||
The `newsfeed ` module is one of the default modules of the MagicMirror.
|
||||
This module displays news headlines based on an RSS feed.
|
||||
|
||||
## Using the module
|
||||
|
||||
To use this module, add it to the modules array in the `config/config.js` file:
|
||||
````javascript
|
||||
modules: [
|
||||
{
|
||||
module: 'newsfeed',
|
||||
position: 'bottom_bar', // This can be any of the regions. Best results in center regions.
|
||||
config: {
|
||||
// The config property is optional.
|
||||
// If no config is set, an example calendar is shown.
|
||||
// See 'Configuration options' for more information.
|
||||
}
|
||||
}
|
||||
]
|
||||
````
|
||||
|
||||
## Configuration options
|
||||
|
||||
The following properties can be configured:
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<!-- why, markdown... -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
<th width="100%">Description</th>
|
||||
</tr>
|
||||
<thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td><code>feedUrl</code></td>
|
||||
<td>The url of the feed used for the headlines.<br>
|
||||
<br><b>Default value:</b> <code>'http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml'</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>showPublishDate</code></td>
|
||||
<td>Display the publish date of an headline.<br>
|
||||
<br><b>Default value:</b> <code>true</code>
|
||||
<br><b>Default value:</b> <code>true</code> or <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>7500</code> (7.5 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>2000</code> (2.5 seconds)
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
153
modules/default/weatherforecast/README.md
Normal file
153
modules/default/weatherforecast/README.md
Normal file
@ -0,0 +1,153 @@
|
||||
# Module: Weather Forecast
|
||||
The `weatherforecast` module is one of the default modules of the MagicMirror.
|
||||
This module displays the weather forecast for the coming week, including an an icon to display the current conditions, the minimum temperature and the maximum temperature.
|
||||
|
||||
## Using the module
|
||||
|
||||
To use this module, add it to the modules array in the `config/config.js` file:
|
||||
````javascript
|
||||
modules: [
|
||||
{
|
||||
module: 'weatherforecast',
|
||||
position: 'top_right', // This can be any of the regions.
|
||||
// Best results in left or right regions.
|
||||
config: {
|
||||
// See 'Configuration options' for more information.
|
||||
location: 'Amsterdam,Netherlands',
|
||||
appid: 'abcde12345abcde12345abcde12345ab' //openweathermap.org API key.
|
||||
}
|
||||
}
|
||||
]
|
||||
````
|
||||
|
||||
## Configuration options
|
||||
|
||||
The following properties can be configured:
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<!-- why, markdown... -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
<th width="100%">Description</th>
|
||||
</tr>
|
||||
<thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td><code>location</code></td>
|
||||
<td>The location used for weather information.<br>
|
||||
<br><b>Example:</b> <code>Amsterdam,Netherlands</code>
|
||||
<br><b>Default value:</b> <code>New York</code>
|
||||
</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?<br>
|
||||
<br><b>Possible values:</b> <code>default</code> = Kelvin, <code>metric</code> = Celsius, <code>imperial</code> =Fahrenheit
|
||||
<br><b>Default value:</b> <code>metric</code>
|
||||
</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>300000</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>2000</code> (2 seconds)
|
||||
</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>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>'forecast/daily'</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>
|
Loading…
x
Reference in New Issue
Block a user