Skip to content

Commit

Permalink
#23 - config options are now applied to lcd display type, created cha…
Browse files Browse the repository at this point in the history
…ngelogs.md file and updated readme
  • Loading branch information
Klizzy committed Feb 13, 2023
1 parent fc6991f commit aa9ced0
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 73 deletions.
2 changes: 1 addition & 1 deletion MMM-Vrr.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ Module.register("MMM-Vrr", {
url = this.vrrLcdUrl();
} else {
url = this.vrrJsonUrl();
url += `&no_lines=${this.config.numberOfResults}&line=${this.config.line}&platform=${this.config.platform}`;
}
url += `&no_lines=${this.config.numberOfResults}&line=${this.config.line}&platform=${this.config.platform}`;

return url;
},
Expand Down
94 changes: 25 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MMM-Vrr and more Areas
# MMM-Vrr and more areas

This is a module for the [MagicMirror²](https://github.com/MichMich/MagicMirror/).

Expand Down Expand Up @@ -35,21 +35,25 @@ To use this module, add the following configuration block to the modules array i

## Configuration options

| Option | Description | Options |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| `city` | _Required_ German City Name <br><br>**Type:** `String` (**default**: Düsseldorf) | Any City Name in North Rhine-Westphalia |
| `station` | _Required_ German Station Name <br><br>**Type:** `String` (**default**: Hauptbahnhof) | Any Station Name in North Rhine-Westphalia |
| `numberOfResults` | _Optional_ Number of results to be displayed <br><br>**Type:** `Int` (**default**: 10) | \* |
| `displayType` | _Optional_ Changes the display type <br><br>**Type:** `String` (**default**: 'detail') | `'detail'`, `'lcd'` |
| `displayIcons` | _Optional_ Display fontawsome icons <br><br>**Type:** `boolean` (**default**: true) | `false` |
| `updateInterval` | _Optional_ Sets the Update Interval int <br><br>**Type:** `int`(milliseconds) <br> **Default** 60000 milliseconds (1 minute) | \* (API result is always cached for 1 Min) |
| `displayTimeOption` | _Optional_ Changes the type of time <br><br>**Type:** `String` (**default**: 'countdown') | `'time'`, `'time+countdown'`, `'countdown'` |
| `setWidth` | _Optional_ Sets the width of the module in pixel <br><br>**Type:** `int` (**default**: false) | Any posible size like: `450` |
| `lcdWidth` | _Optional_ Sets the width of the lcd display type <br><br>**Type:** `int` (**default**: 450) | any possible size |
| `scrollAfter` | _Optional_ Scrolls the destination text after the specified characters <br><br>**Type:** `int` (**default**: false) | any possible size or `false` |
| `withoutDestination` | _Optional_ Only show results without destination. Supports a list of strings, separated by comma (","). <br><br>**Type:** `list of strings` (**default**: empty list (show all destinations)) | any possible list (e.g., ["Aachen, Hbf,Aachen","Duisburg Hbf"]) |
| `platform` | _Optional_ Only show platform. Supports multiple strings, separated by comma (","). <br><br>**Type:** `string` (**default**: empty (show all platforms)) | any possible string (e.g., "2,3") |
| `line` | _Optional_ Only show lines that start with the given string. Supports multiple strings, separated by comma (","). <br><br>**Type:** `string` (**default**: empty (i.e., show all lines)) | any possible string (e.g., "RB33,U") |
<div style="text-align: center;">

| Option | Description | Options | LCD type support |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |------------------|
| `city` | _Required_ German City Name <br><br>**Type:** `String` (**default**: Düsseldorf) | Any City Name in North Rhine-Westphalia ||
| `station` | _Required_ German Station Name <br><br>**Type:** `String` (**default**: Hauptbahnhof) | Any Station Name in North Rhine-Westphalia ||
| `numberOfResults` | _Optional_ Number of results to be displayed <br><br>**Type:** `Int` (**default**: 10) | \* ||
| `displayType` | _Optional_ Changes the display type <br><br>**Type:** `String` (**default**: 'detail') | `'detail'`, `'lcd'` ||
| `displayIcons` | _Optional_ Display fontawsome icons <br><br>**Type:** `boolean` (**default**: true) | `false` ||
| `updateInterval` | _Optional_ Sets the Update Interval int <br><br>**Type:** `int`(milliseconds) <br> **Default** 60000 milliseconds (1 minute) | \* (API result is always cached for 1 Min) ||
| `displayTimeOption` | _Optional_ Changes the type of time <br><br>**Type:** `String` (**default**: 'countdown') | `'time'`, `'time+countdown'`, `'countdown'` ||
| `setWidth` | _Optional_ Sets the width of the module in pixel <br><br>**Type:** `int` (**default**: false) | Any posible size like: `450` ||
| `lcdWidth` | _Optional_ Sets the width of the lcd display type <br><br>**Type:** `int` (**default**: 450) | any possible size ||
| `scrollAfter` | _Optional_ Scrolls the destination text after the specified characters <br><br>**Type:** `int` (**default**: false) | any possible size or `false` ||
| `withoutDestination` | _Optional_ Only show results without destination. Supports a list of strings, separated by comma (","). <br><br>**Type:** `list of strings` (**default**: empty list (show all destinations)) | any possible list (e.g., ["Aachen, Hbf,Aachen","Duisburg Hbf"]) ||
| `platform` | _Optional_ Only show platform. Supports multiple strings, separated by comma (","). <br><br>**Type:** `string` (**default**: empty (show all platforms)) | any possible string (e.g., "2,3") ||
| `line` | _Optional_ Only show lines that start with the given string. Supports multiple strings, separated by comma (","). <br><br>**Type:** `string` (**default**: empty (i.e., show all lines)) | any possible string (e.g., "RB33,U") ||

</div>

## Support

Expand All @@ -65,9 +69,12 @@ If you like my module and want to thank, you could consider:
Currently only `de` and `en` is supported. Gets the Value from the Global Magic Mirror language config.

## "LCD" Display
This view can be set if `displayType: 'lcd'` has been set.

**Not all config parameters are supported in this mode. Check the parameters within the "Configuration options" table.**

![lcd](mmm-vrr.png)</br>
This option can be set if `displayType: 'lcd'` is added. Here, no delays, icons or absolute times are shown.


## Visualization of the scrollAfter option

Expand Down Expand Up @@ -126,55 +133,4 @@ Feel free to suggest additional features and / or improvements.

## Changelog

#### Version 1.0

- initial release

#### Version 1.1

- added some additional configuration to set a custom width
- added the option to scroll the destination text horizontally

#### Version 1.2

- now displays delays

#### Version 1.5

- delay bugfix and styling changes
- rail track is now displayed
- added additional display type

#### Version 1.5.1

- fix for [Issue #3](https://github.com/Klizzy/MMM-Vrr/issues/3) scrollAfter and displayType lcd

#### Version 1.6

- shown lines can now be filtered and code improvements. THX [@wapolinar](https://github.com/wapolinar) !
- added `contributing.md`

#### Version 1.6.1

- Bugfix for station configurations which get fewer results then specified in the config. THX [@byWulf](https://github.com/byWulf) !
- Set correct module version in `package.json`

#### Version 1.6.2

- Bugfix for typo in default variable name for `lcdWidth`. THX [@MarNwk](https://github.com/MarNwk) !
- Fixed the same typo where the config has been read
- `setAttribute()` will now be used to set the configured value, instead of direct interaction with the `style` property
- Set correct module version in `package.json`

#### Version 1.6.3

- Bugfix for LCD displayType option not updating - see [issue 14](https://github.com/Klizzy/MMM-Vrr/issues/14) for more details
- Refactoring code to make it more readable
- `setAttribute()` will now be used to set the configured value, instead of direct interaction with the properties
- Set correct module version in `package.json`

#### Version 1.6.4

- Added npm request dependency into module see [issue 14](https://github.com/Klizzy/MMM-Vrr/issues/14)
- Added keywords into package.json
- Added `package-lock.json`
See [changelog.md](https://github.com/Klizzy/MMM-Vrr/changelog.md) to view changes and contributors.
58 changes: 58 additions & 0 deletions changelogs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#### Version 1.0

- initial release

#### Version 1.1

- added some additional configuration to set a custom width
- added the option to scroll the destination text horizontally

#### Version 1.2

- now displays delays

#### Version 1.5

- delay bugfix and styling changes
- rail track is now displayed
- added additional display type

#### Version 1.5.1

- fix for [Issue #3](https://github.com/Klizzy/MMM-Vrr/issues/3) scrollAfter and displayType lcd

#### Version 1.6

- shown lines can now be filtered and code improvements. THX [@wapolinar](https://github.com/wapolinar) !
- added `contributing.md`

#### Version 1.6.1

- Bugfix for station configurations which get fewer results then specified in the config. THX [@byWulf](https://github.com/byWulf) !
- Set correct module version in `package.json`

#### Version 1.6.2

- Bugfix for typo in default variable name for `lcdWidth`. THX [@MarNwk](https://github.com/MarNwk) !
- Fixed the same typo where the config has been read
- `setAttribute()` will now be used to set the configured value, instead of direct interaction with the `style` property
- Set correct module version in `package.json`

#### Version 1.6.3

- Bugfix for LCD displayType option not updating - see [issue 14](https://github.com/Klizzy/MMM-Vrr/issues/14) for more details
- Refactoring code to make it more readable
- `setAttribute()` will now be used to set the configured value, instead of direct interaction with the properties
- Set correct module version in `package.json`

#### Version 1.6.4

- Added npm request dependency into module see [issue 14](https://github.com/Klizzy/MMM-Vrr/issues/14)
- Added keywords into package.json
- Added `package-lock.json`

#### Version 1.6.5

- Config parameters are now also applied on `displayType: lcd` view [issue 14](https://github.com/Klizzy/MMM-Vrr/issues/14)
- Updated readme
- Migrated changelog into `changelogs.md`
4 changes: 2 additions & 2 deletions 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": "Magic-Mirror-Module-Vrr",
"version": "1.6.4",
"version": "1.6.5",
"description": "Displays the next departure times of Trains, subway and Busses from any city and station in the german federal state North Rhine-Westphalia",
"main": "MMM-Vrr.js",
"author": "Steven Zemelka <[email protected]>",
Expand Down

0 comments on commit aa9ced0

Please sign in to comment.