Skip to content

Commit

Permalink
add config option transitionTime
Browse files Browse the repository at this point in the history
  • Loading branch information
fewieden committed May 12, 2020
1 parent 3638f02 commit 781bd3d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# MMM-ping Changelog

## [2.0.1]

### Added

* Config option `transitionTime`

## [2.0.0]

### Added
Expand Down
6 changes: 4 additions & 2 deletions MMM-ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ Module.register('MMM-ping', {
* @property {string[]} hosts - List of hosts to ping.
* @property {int} updateInterval - Speed of update.
* @property {string} font - Class name for font size.
* @property {number} transitionTime - Time the transition for a new update in the DOM should take.
*/
defaults: {
colored: false,
display: 'both',
hosts: [],
updateInterval: 5,
font: 'medium'
font: 'medium',
transitionTime: 300
},

/**
Expand Down Expand Up @@ -156,7 +158,7 @@ Module.register('MMM-ping', {
socketNotificationReceived(notification, payload) {
if (notification === 'STATUS_UPDATE') {
this.status = payload;
this.updateDom(300);
this.updateDom(this.config.transitionTime);
}
},

Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ Ping Module for MagicMirror<sup>2</sup>

| **Option** | **Default** | **Description** |
| --- | --- | --- |
| `colored` | false | show badge in color or not |
| `display` | 'both' | what should be displayed `'online'`, `'offline'` or `'both'` |
| `hosts` | [] | addresses to ping |
| `updateInterval` | 5 | how often the module should ping the hosts in minutes |
| `font` | 'medium' | font size `'xsmall'`, `'small'`, `'medium'`, `'large'` or `'xlarge'` |
| `colored` | `false` | show badge in color or not |
| `display` | `'both'` | what should be displayed `'online'`, `'offline'` or `'both'` |
| `hosts` | `[]` | addresses to ping |
| `updateInterval` | `5` | how often the module should ping the hosts in minutes |
| `font` | `'medium'` | font size `'xsmall'`, `'small'`, `'medium'`, `'large'` or `'xlarge'` |
| `transitionTime` | `300` | Time (in milliseconds) the transition for a new update in the DOM should take. |

## OPTIONAL: Voice Control and Modal

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mmm-ping",
"version": "2.0.0",
"version": "2.0.1",
"description": "Ping Module for MagicMirror2",
"scripts": {
"lint": "./node_modules/.bin/eslint . && ./node_modules/.bin/stylelint **/*.css",
Expand Down

0 comments on commit 781bd3d

Please sign in to comment.