Skip to content
This repository was archived by the owner on Mar 14, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions MMM-Ruter.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,27 @@ Module.register("MMM-Ruter",{
if (this.config.showHeader) {
table.appendChild(this.getTableHeaderRow());
}


var shouldAddLine = function (journey, stops) {
for (var i = 0; i < stops.length; i++) {
if(stops[i].stopId == journey.stopId) {
if(stops[i].lineNames === undefined) { return true };
if(stops[i].lineNames.indexOf(journey.lineName) != -1) {
return true
} else { return false }
} else { return false }
}

};

for(var i = 0; i < this.journeys.length; i++) {

var journey = this.journeys[i];
var tr = this.getTableRow(journey);

if(!shouldAddLine(journey, this.config.stops)){
continue;
}
// Create fade effect. <-- stolen from default "calendar" module
if (this.config.fade && this.config.fadePoint < 1) {
if (this.config.fadePoint < 0) {
Expand Down Expand Up @@ -318,4 +333,4 @@ Module.register("MMM-Ruter",{
return moment(t).format(this.config.timeFormat);
}
}
});
});
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ stopId | Id of stop
stopName | Override name of the stop if you know it by another name or want to keep it short. You have to enable `showStopName` in module configuration.
platformFilter | The names of the platforms you want to see. Please temporarely enable `showPlatformName` in the module configuration to get the correct platform names before you configure this option. If these names aren't valid, nothing will be displayed.
timeToThere | How long time in minutes does it take for you to get to this stop? It's no point showing journeys that till go in 1 minute if it takes you 5 minutes to get there...
lineNames | List the lines relevant to you. Example: `lineNames: ["17", "31"]` will only show line 17 and line 31.

Example:
```
Expand Down