Skip to content

Commit

Permalink
Merge pull request #2 from crisvdn/feature/add-readme
Browse files Browse the repository at this point in the history
Feature/add readme
  • Loading branch information
crisvdn authored Jan 27, 2024
2 parents 0019dcd + 38da795 commit 2f802a9
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 5 deletions.
7 changes: 3 additions & 4 deletions MMM-MTG.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@ const commander = '/cards/random?q=is%3Acommander';

Module.register("MMM-MTG", {
defaults: {
text: "MTG",
sizePx: '450px',
showCommandersOnly: true,
interval: 1,
FetchInterval: 1,
},
imageUri: "",
requiresVersion: "2.25.0",

start: async function() {
this.getData();
if(this.config.interval > 0){
if(this.config.FetchInterval > 0){
setInterval(() => {
this.getData();
}, this.config.interval * 60000);
}, this.config.FetchInterval * 60000);
}
},

Expand Down
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,39 @@
# MMM-MTG
# MMM-MTG

## Introduction

This module fetches a MTG random card from Scryfall.
Depending on configurations, it will fetch commanders only (legendary creatures) or random cards.

![Example of MTG module](images/example.png?raw=true "Example")


## configuration

Minimal configuration
```json
{
module: "MMM-MTG",
position: "bottom_right", // location
},
```


| Configuration | values | summary | default |
| ----- | ------ | ----- | ----- |
| showCommandersOnly | `true/false` | Shows legendary creatures only or random cards | `true` |
| FetchInterval | 0-X | Fetch interval in minutes. 0 is disabled. | 1 |
| sizePx | 0-X px | Max size in height (string) | `450px` |

Example configuration
```json
{
module: "MMM-MTG",
position: "bottom_right", // location
config: {
showCommandersOnly: false,
FetchInterval: 10, // every 10 minutes
sizePx: "300px", //
}
},
```
Binary file added images/example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2f802a9

Please sign in to comment.