Skip to content

Commit

Permalink
Merge branch 'release/v1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
frdteknikelektro committed Feb 19, 2017
2 parents 155a1a8 + 74f0c6b commit a807273
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
13 changes: 12 additions & 1 deletion MMM-SimpleLogo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@ Module.register("MMM-SimpleLogo", {
text: "Simple Logo",
fileUrl: "modules/MMM-SimpleLogo/public/logo.png",
width: "200px",
position: "left"
position: "left",
refreshInterval: 0
},

start: function() {
if (this.config.refreshInterval > 0) {
var self = this;
setInterval(function() {
img = document.querySelector('.simple-logo__container img');
img.setAttribute('src', self.config.fileUrl + '?' + Date.now());
}, this.config.refreshInterval);
}
},

getStyles: function () {
Expand Down
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# Module: MMM-SimpleLogo
The `MMM-SimpleLogo` module is third party modules of the MagicMirror.
This module simply displays logo.

The `MMM-SimpleLogo` module is third party modules of the MagicMirror. This module simply displays logo.

## Using the module

To use this module, add it to the modules array in the `config/config.js` file:
````javascript

```javascript
modules: [
{
module: 'MMM-SimpleLogo',
position: 'top_left', // This can be any of the regions.
config: {
// The config property is optional.
// See 'Configuration options' for more information.
}
}
{
module: 'MMM-SimpleLogo',
position: 'top_left', // This can be any of the regions.
config: {
// The config property is optional.
// See 'Configuration options' for more information.
}
}
]
````
```

## Configuration options

Expand Down Expand Up @@ -52,5 +53,12 @@ The following properties can be configured:
<br><b>Default value:</b> <code>left</code>
</td>
</tr>
<tr>
<td><code>refreshInterval</code></td>
<td>Refresh/refetch image file between interval. Only use this if your image url return different image after some interval of time, even the <code>fileUrl</code> is not changed. See this case #2, awesome project by @ElYoM <br>
<br><b>Possible values:</b> <code>1000</code>, <code>2000</code>, or <code>10000</code>
<br><b>Default value:</b> <code>0</code> (disabled)
</td>
</tr>
</tbody>
</table>

0 comments on commit a807273

Please sign in to comment.