This is a module for the MagicMirror² smart mirror project.
This module is intended to assist with module development. It displays a list of notifications that have been broadcast to all the modules.
Status | Version | Date | Maintained? |
---|---|---|---|
Working | 1.0.1 |
2021-12-28 | Yes |
- None
To install the module, use your terminal to:
- Navigate to your MagicMirror's modules folder. If you are using the default installation directory, use the command:
cd ~/MagicMirror/modules
- Copy the module to your computer by executing the following command:
git clone https://github.com/glitch452/MMM-ViewNotifications.git
To use this module, add the following configuration block to the modules array in the config/config.js
file:
var config = {
modules: [
{
...
module: 'MMM-ViewNotifications',
position: "top_left",
header: "Notifications",
config: {
// See below for Configuration Options
}
},
...
]
}
Option | Description |
---|---|
timeout |
Optional - How long (in seconds) the notification should stay on the screen, set to 0 to keep indefinitely. Type: number Default: 8 |
maximum |
Optional - The maximum number of notifications to show, set to 0 for unlimited (new ones push out older ones). Type: number Default: 8 |
icons |
Optional - The icons to use for notifications from specific modules. The object is formatted as follows: { module_name: 'icon_name' } where the module_name is the name of a module and icon_name is the name of an icon from Font Awesome. Type: object Default: { calendar: 'calendar', clock: 'clock-o', currentweather: 'thermometer', weatherforecast: 'thermometer' } |
defaultIcon |
Optional - The default icon to use for a module who's icon is not set in the icons list. type: string Default: 'bullhorn' |
newestOnTop |
Optional - If true, new notifications are added to the top of the list, if false, the bottom. Type: boolean Default: true |
includeModules |
Optional - A white list of modules, if not empty, only notifications from these modules will be displayed. Type: array Default: [] |
excludeModules |
Optional - A black list of modules, notifications from these modules will not be displayed. Type: array Default: [] |
includeNotifications |
Optional - A white list of notifications, if not empty, only notifications of these types will be displayed. Type: array Default: [] |
excludeNotifications |
Optional - A black list of modules, notifications of these types will not be displayed. Type: array Default: [] |
format |
Optional - The format to use for the notification item added to the list. Type: string Default: '{time}: "{module}" sent "{notification}"' Options: - '{notification}' The name of the notification- '{module}' The name of the module that sent the notification- '{payloadList}' A list of properties in the payload object- '{payloadData}' A JSON string representing the payload data in the notification- '{date}' The date that the notification was sent in the YYYY-MM-DD format- '{time}' The date that the notification was sent in the HH:mm:ss format- '{date|format}' The date/time that the notification was sent, in the specified format, using moment.js for formatting rules. Ex: '{date|HH:mm}' |
To update the module to the latest version, use your terminal to:
- Navigate to your MMM-ViewNotifications folder. If you are using the default installation directory, use the command:
cd ~/MagicMirror/modules/MMM-ViewNotifications
- Update the module by executing the following command:
git pull
If you have changed the module on your own, the update will fail.
To force an update (WARNING! your changes will be lost), reset the module and then update with the following commands:
git reset --hard
git pull
To use an older version of this module, use your terminal to:
- Navigate to your MMM-PlexNowPlaying folder. If you are using the default installation directory, use the command:
cd ~/MagicMirror/modules/MMM-ViewNotifications
- Fetch all the available tags
git fetch
- Show all the available tags
git tag
- Checkout one of the available tags
git checkout {tag_name}
Example:git checkout v1.0.0
To switch back to the latest version, use your terminal to:
- Navigate to your MMM-PlexNowPlaying folder. If you are using the default installation directory, use the command:
cd ~/MagicMirror/modules/MMM-ViewNotifications
- Checkout the master branch
git checkout master
Copyright © 2018 David Dearden
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.