mirror of
				https://github.com/MichMich/MagicMirror.git
				synced 2025-10-31 10:48:10 +00:00 
			
		
		
		
	
		
			
				
	
	
	
		
			3.1 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			3.1 KiB
		
	
	
	
	
	
	
	
Module: Alert
The alert module is one of the default modules of the MagicMirror. This module displays notifications from other modules.
Usage
To use this module, add it to the modules array in the config/config.js file:
modules: [
	{
		module: "alert",
		config: {
			// The config property is optional.
			// See 'Configuration options' for more information.
		}
	}
]
Configuration options
The following properties can be configured:
| Option | Description | 
|---|---|
| effect | The animation effect to use for notifications. Possible values: scaleslidegeniejellyflipexploaderbouncyflipDefault value: slide | 
| alert_effect | The animation effect to use for alerts. Possible values: scaleslidegeniejellyflipexploaderbouncyflipDefault value: jelly | 
| display_time | Time a notification is displayed in milliseconds. Possible values: intDefault value: 3500 | 
| position | Position where the notifications should be displayed. Possible values: leftcenterrightDefault value: center | 
| welcome_message | Message shown at startup. Possible values: stringfalseDefault value: false(no message at startup) | 
Developer notes
For notifications use:
self.sendNotification("SHOW_ALERT", {type: "notification"});
For alerts use:
self.sendNotification("SHOW_ALERT", {});
Notification params
| Option | Description | 
|---|---|
| title | The title of the notification. Possible values: textorhtml | 
| message | The message of the notification. Possible values: textorhtml | 
Alert params
| Option | Description | 
|---|---|
| title | The title of the alert. Possible values: textorhtml | 
| message | The message of the alert. Possible values: textorhtml | 
| imageUrl(optional) | Image to show in the alert Possible values: urlpathDefault value: none | 
| imageFA(optional) | Font Awesome icon to show in the alert Possible values: See Font Awsome website. Default value: none | 
| imageHeight(optional even with imageUrl set) | Height of the image Possible values: intpxDefault value: 80px | 
| timer(optional) | How long the alert should stay visible in ms. Important: If you do not use the timer, it is your duty to hide the alert by usingself.sendNotification("HIDE_ALERT");!Possible values: intfloatDefault value: none | 
Open Source Licenses
NotificationStyles
See ympanus.net for license.