diff --git a/README.md b/README.md index a109313..ce34f2f 100755 --- a/README.md +++ b/README.md @@ -112,36 +112,36 @@ These are the possible options: | Option | Description | |--------|-------------| | `hafasProfile` |

The name of the hafas profile.

**Type:** `string`
**Example:** `"insa"`
**Default value:** `"db"`

**Note:** In most cases you don't need to change the value. You can find supported profiles and there names [here](https://github.com/public-transport/hafas-client/blob/master/p/readme.md).

Each profile uses its own StationIDs. So if you change the profile, you have to find out the StationID again.

| -| `stationID` |

The ID you want to display departures for.

**REQUIRED**
**Type:** `string`
**Example:** `"008012202"`
**Default value:** none

**Note:** How to get the ID is described [here](#how-to-get-the-stationid).

| +| `stationID` |

The ID you want to display departures for.

**REQUIRED**
**Type:** `string`
**Example:** `"8012202"`
**Default value:** none

**Note:** How to get the ID is described [here](#how-to-get-the-stationid).

| | `stationName` |

The name of the station as it should appear on the display.

**Type:** `string`
**Example:** `"Wilhelm-Leuschner-Platz"`
**Default value:** none

**Note:** If you leave this setting, `headerPrefix` and `headerAppendix` blank the module will show an empty header.

| -| `headerPrefix` |

The text to be prepended to the `stationName`.

**Type:** `string`
**Example:** `"von"` (Will result in “von Wilhelm-Leuschner-Platz” being displayed.)
**Default value:** `""`

**Note:** A blank between `headerPrefix` and `stationName` is automatically inserted.

| +| `headerPrefix` |

The text to be prepended to the `stationName`.

**Type:** `string`
**Example:** `"von"` (Will result in “von Wilhelm-Leuschner-Platz” being displayed.)
**Default value:** `""`

**Note:** A blank between `headerPrefix` and `stationName` is automatically inserted.

| | `headerAppendix` |

The text to be prepended to the `stationName`.

**Type:** `string`
**Example:** `"(Richtung HBF)"`
**Default value:** `""`

**Note:** A blank between `headerAppendix` and `stationName` is automatically inserted.

| -| `updatesEvery` |

The time in seconds when the displayed departures should be updated.

**Type:** `integer`
**Example:** `60` (The departures will be refreshed every minute.)
**Default value:** `120`

**Note:** The minimal refresh time is 30 seconds.

| -| `direction` |

An ID of a station. It is used to display only those departures heading to this station.

**Type:** `string`
**Example:** `"000954609"`
**Default value:** `""`

**Note:** It is not neccessary to find the ID of the end station. Just use the next station which is on the route you are after.
It is not possible to list multiple IDs. If you want to display different directions for one station use multiple instances of this module.

| -| `ignoredLines` |

An array of strings describing the lines you want to exclude from the displayed departures.

**Type:** `array`
**Example:** `[ "STR 11", "STR 10" ]` (Displays all lines except tram 10 and 11.)
**Default value:** `[]`

**Note:** You need to provide the line names exactly as they are otherwise displayed. This setting is case sensitive. Blanks need to be exactly as they are display. If a line is usually displayes as `BUS 89` (two blanks) you need to type exactly that into the array.

| +| `updatesEvery` |

The time in seconds when the displayed departures should be updated.

**Type:** `integer`
**Example:** `60` (The departures will be refreshed every minute.)
**Default value:** `120`
**Unit:** `seconds`

**Note:** The minimal refresh time is 30 seconds.

| +| `direction` |

An ID of a station. It is used to display only those departures heading to this station.

**Type:** `string`
**Example:** `"954609"`
**Default value:** `""`

**Note:** It is not neccessary to find the ID of the end station. Just use the next station which is on the route you are after.
It is not possible to list multiple IDs. If you want to display different directions for one station use multiple instances of this module.

| +| `ignoredLines` |

An array of strings describing the lines you want to exclude from the displayed departures.

**Type:** `array`
**Example:** `[ "STR 11", "STR 10" ]` (Displays all lines except tram 10 and 11.)
**Default value:** `[]`

**Note:** You need to provide the line names exactly as they are otherwise displayed. This setting is case sensitive. Blanks need to be exactly as they are display. If a line is usually displayes as `BUS 89` (two blanks) you need to type exactly that into the array.

| | `ignoreRelatedStations` |

Ignore departures from related stations or not.

**Type:** `boolean`
**Default value:** `false`
**Possible values:** `true` and `false`

**Note:** Usually you don't need to touch this option.

| | `excludedTransportationTypes` |

An array of strings describing the transportation types you want to exclude from the displayed departures.

**Type:** `array`
**Example:** `[ "suburban", "bus" ]`
**Default value:** `[]`
**Possible values:**
TypeUse in Germany
`"bus"`bus
`"ferry"`Fähre
`"express"`?
`"national"`IC trains
`"nationalExpress"`ICE trains
`"regional"`RB or RE
`"suburban"`S-Bahn
`"subway"`U-Bahn
`"tram"`Tram
`"taxi"`Taxi

| -| `timeToStation` |

An integer indicating how long it takes you to get to the station.

**Type:** `integer`
**Example:** `5`
**Default value:** `10`

**Note:** The time is given in minutes.

| -| `timeInFuture` |

An integer indicating how far in the future a departure can be to be still included in the shown departures.

**Type:** `integer`
**Example:** `60` (Show departures for the next hour.)
**Default value:** `40`

**Note:** The time is given in minutes.
Use this setting on stations where there is a big time gap between departures. This way you will see more than one or two departures. **Don’t use** this setting to limit the amount of displayed departures! The module will set this value to be at least `timeToStation + 30` anyway. Use the option `maxReachableDepartures` to limit the displayed departures.

| -| `marqueeLongDirections` |

A boolean value indicating whether you want scrolling long destination name or not.

**Type:** `boolean`
**Example:** `false`
**Default value:** `true`

**Note:** If set to `true` destination names longer than 24 characters will scroll through the display. If set to `false` names will be truncated at 24 characters.

| -| `replaceInDirections` |

An object defining strings which are to be replaced in the displayed directions.

**Type:** `object`
**Example:** `{ "Leipzig": "LE", "\\(Saale\\)": "", "Hbf": "" }`
**Default value:** `{}`

**Note:** The strings which appear as the keys of the object will be replaced by their values. Given a direction `"Leipzig, Hbf"` and the above mentioned example setting the displayed direction will be `"LE,"`. `"Leipzig"` was replaced by `"LE"` and `"Hbf"` was replaced by the empty string. If you want to replace special symbols like `"("`, `")"` or `"-"` you must escape these characters by placing **two** `"\"` in front of the character (see example above).

| -| `showColoredLineSymbols` |

A boolean value indicating whether the line symbols should be colored or black and white.

**Type:** `boolean`
**Example:** `false`
**Default value:** `true`

**Note:** If set to `true` it is possible to decorate the line labels with the colors which are used in your town. This module comes with decorations for Leipzig. To provide your own colors see [Providing a custom css file](#providing-a-custom-css-file).

| -| `useColorForRealtimeInfo` |

A boolean value indicating whether delays should be displayed in color.

**Type:** `boolean`
**Example:** `false`
**Default value:** `true`

**Note:** If set to `true` a delay will be displayed in red. Values `<= 0` (transport arrives in time or early) will be displayed in green. If you want to customize that see [Providing a custom css file](#customizing-the-color-for-delays).

| -| `showAbsoluteTime` |

A boolean indicating whether the departure time should be displayed as an absolute value or not.

**Type:** `boolean`
**Example:** `false`
**Default value:** `true`

**Note:** If set to `true` the departure time would be displayed as “10:15+0”. If set to `false` the departure time would be displayed in a relative manner like so: `in 5 minutes`. The displayed string is determined by your locale. If your locale is set to `de` the string would be `in 5 Minuten`.

| -| `showTableHeaders` |

A boolean indicating whether a table header should be shown or not.

**Type:** `boolean`
**Example:** `false`
**Default value:** `true`

**Note:** If set to `false` no table headings like “time” or “direction” will be shown. Also no symbols are shown.

| -| `showTableHeadersAsSymbols` |

A boolean value indicating whether table headers should be shown as symbols or text.

**Type:** `boolean`
**Example:** `false`
**Default value:** `true`

**Note:** If set to `true` table headers will use symbols, else text will be shown. This setting is only effective if `showTableHeaders` is set to `true`. The shown text is available in English and German. Feel free to add translations to this project.

| -| `showWarningRemarks` |

A boolean value indicating whether warnings attached to a trip should be shown.

**Type:** `boolean`
**Example:** `false`
**Default value:** `true`

**Note:** If set to `true` and a warning is attached to a trip it will be shown in a additional row. This default width of this row is `80ch`, the whole table is then given this width. If you want to change that, set a different value in your `custom.css` such as: `.pthWarningRemarks { width: 70ch; }`.

| -| `tableHeaderOrder` |

An array determining the order of the table headers.

**Type:** `array`
**Example:** `[ "line", "direction", "time", "platform" ]`
**Default value:** `[ "time", "line", "direction", "platform" ]`

**Note 1:** If the HAFAS API does not provide information about the platforms of your station, you can remove the column here by removing `"platform"`.

**Note 2:** Sort the table headings as you like it. Please keep in mind that you can only use the values `"line"`, `"time"`, `"direction"` and `"platform"`.

| +| `timeToStation` |

An integer indicating how long it takes you to get to the station.

**Type:** `integer`
**Example:** `5`
**Default value:** `10`
**Unit:** `minutes`

| +| `timeInFuture` |

An integer indicating how far in the future a departure can be to be still included in the shown departures.

**Type:** `integer`
**Example:** `60` (Show departures for the next hour.)
**Default value:** `40`
**Unit:** `minutes`

**Note:** Use this setting on stations where there is a big time gap between departures. This way you will see more than one or two departures. **Don’t use** this setting to limit the amount of displayed departures! The module will set this value to be at least `timeToStation + 30` anyway. Use the option `maxReachableDepartures` to limit the displayed departures.

| +| `marqueeLongDirections` |

A boolean value indicating whether you want scrolling long destination name or not.

**Type:** `boolean`
**Default value:** `true`
**Possible values:** `true` and `false`

**Note:** If set to `true` destination names longer than 24 characters will scroll through the display. If set to `false` names will be truncated at 24 characters.

| +| `replaceInDirections` |

An object defining strings which are to be replaced in the displayed directions.

**Type:** `object`
**Example:** `{ "Leipzig": "LE", "\\(Saale\\)": "", "Hbf": "" }`
**Default value:** `{}`

**Note:** The strings which appear as the keys of the object will be replaced by their values. Given a direction `"Leipzig, Hbf"` and the above mentioned example setting the displayed direction will be `"LE,"`. `"Leipzig"` was replaced by `"LE"` and `"Hbf"` was replaced by the empty string. If you want to replace special symbols like `"("`, `")"` or `"-"` you must escape these characters by placing **two** `"\"` in front of the character (see example above).

| +| `showColoredLineSymbols` |

A boolean value indicating whether the line symbols should be colored or black and white.

**Type:** `boolean`
**Default value:** `true`
**Possible values:** `true` and `false`

**Note:** If set to `true` it is possible to decorate the line labels with the colors which are used in your town. This module comes with decorations for Leipzig. To provide your own colors see [Providing a custom css file](#providing-a-custom-css-file).

| +| `useColorForRealtimeInfo` |

A boolean value indicating whether delays should be displayed in color.

**Type:** `boolean`**Default value:** `true`
**Possible values:** `true` and `false`

**Note:** If set to `true` a delay will be displayed in red. Values `<= 0` (transport arrives in time or early) will be displayed in green. If you want to customize that see [Providing a custom css file](#customizing-the-color-for-delays).

| +| `showAbsoluteTime` |

A boolean indicating whether the departure time should be displayed as an absolute value or not.

**Type:** `boolean`
**Default value:** `true`
**Possible values:** `true` and `false`

**Note:** If set to `true` the departure time would be displayed as “10:15+0”. If set to `false` the departure time would be displayed in a relative manner like so: `in 5 minutes`. The displayed string is determined by your locale. If your locale is set to `de` the string would be `in 5 Minuten`.

| +| `showTableHeaders` |

A boolean indicating whether a table header should be shown or not.

**Type:** `boolean`
**Default value:** `true`
**Possible values:** `true` and `false`

**Note:** If set to `false` no table headings like “time” or “direction” will be shown. Also no symbols are shown.

| +| `showTableHeadersAsSymbols` |

A boolean value indicating whether table headers should be shown as symbols or text.

**Type:** `boolean`
**Default value:** `true`
**Possible values:** `true` and `false`

**Note:** If set to `true` table headers will use symbols, else text will be shown. This setting is only effective if `showTableHeaders` is set to `true`. The shown text is available in English and German. Feel free to add translations to this project.

| +| `showWarningRemarks` |

A boolean value indicating whether warnings attached to a trip should be shown.

**Type:** `boolean`
**Default value:** `true`
**Possible values:** `true` and `false`

**Note:** If set to `true` and a warning is attached to a trip it will be shown in a additional row. This default width of this row is `80ch`, the whole table is then given this width. If you want to change that, set a different value in your `custom.css` such as: `.pthWarningRemarks { width: 70ch; }`.

| +| `tableHeaderOrder` |

An array determining the order of the table headers.

**Type:** `array`
**Example:** `[ "line", "direction", "time", "platform" ]`
**Default value:** `[ "time", "line", "direction", "platform" ]`

**Note 1:** If the HAFAS API does not provide information about the platforms of your station, you can remove the column here by removing `"platform"`.

**Note 2:** Sort the table headings as you like it. Please keep in mind that you can only use the values `"line"`, `"time"`, `"direction"` and `"platform"`.

| | `maxUnreachableDepartures` |

An integer value denoting how many unreachable departures should be displayed.

**Type:** `integer`
**Example:** `3`
**Default value:** `0`

**Note:** A departure is unreachable if you can't reach the station in time for the departure with respect to your `timeToStation` setting.
Sometimes it is useful to set this option to a value greater than `0` if you are the type of person which walks really fast. Maybe other users of the mirror usually take 10 minutes to the station but you take only 5. So you’ll see also departures the other users couldn’t reach.

| -| `maxReachableDepartures` |

An integer value denoting how many reachable departures should be displayed.

**Type:** `integer`
**Example:** `5`
**Default value:** `7`

**Note:** A departure is reachable if you can make it to the station in time for the departure with respect to your `timeToStation` setting.

| -| `fadeUnreachableDepartures` |

A boolean value indicating whether unreachable departures should be dimmed.

**Type:** `boolean`
**Example:** `false`
**Default value:** `true`

| -| `fadeReachableDepartures` |

A boolean value indicating whether reachable departures should be faded out.

**Type:** `boolean`
**Example:** `false`
**Default value:** `true`

**Note:** If set to `true` departures after `fadePointForReachableDepartures` will be gradually faded out so that the last departure is barely visible.

| -| `fadePointForReachableDepartures` |

A floating point value indicating where to start the fading of departure rows.

**Type:** `float`
**Example:** `0.5` (Start fading after half of the rows.)
**Default value:** `0.25`

**Note:** This value is actually a percentage. The Default value of `0.25` denotes that after a quarter of the visible rows set by `maxReachableDepartures` the fading should start. This setting is only effective if `fadeReachableDepartures` is set to `true`.

| -| `customLineStyles` |

A string value describing the name of a custom css file.

**Type:** `string`
**Example:** `"dresden"`
**Default value:** `"leipzig"`

**Note:** If the setting `showColoredLineSymbols` is `true` the module will try to use colored labels for the line name. Per default it uses the colors used in Leipzig. This style works best if `showOnlyLineNumbers` is set to `true`. If it doesn’t suit your taste you can provide your own settings. See [Providing a custom css file](#providing-a-custom-css-file).

| -| `showOnlyLineNumbers` |

A boolean value denoting whether the line name should be displayed as a number only or the full name should be used.

**Type:** `boolean`
**Example:** `true`
**Default value:** `false`

**Note:** If set to `true` the module will try to separate line numbers from the line name and display only these. If the line name is “STR 11” only “11” will be displayed. This only works if there are blanks present in the line name. This setting is only tested with departures in Leipzig. If you encounter problems [let me know](https://github.com/KristjanESPERANTO/MMM-PublicTransportHafas/issues).

| -| `displayLastUpdate` |

If true this will display the last update time at the end of the task list. See screenshot above

**Type:** `boolean`
**Default value:** `true`

| -| `displayLastUpdateFormat` |

Format to use for the time display if displayLastUpdate:true

**Type:** `string`
**Example:** `'dd - HH:mm:ss'`
**Default value:** `'dd - HH:mm:ss'`

See [Moment.js formats](http://momentjs.com/docs/#/parsing/string-format/) for the other format possibilities.

| -| `animationSpeed` |

Speed of the update animation. (Milliseconds)

**Type:** `integer`
**Possible values:** `0` - `5000`
**Default value:** `2000`

| +| `maxReachableDepartures` |

An integer value denoting how many reachable departures should be displayed.

**Type:** `integer`
**Example:** `5`
**Default value:** `7`

**Note:** A departure is reachable if you can make it to the station in time for the departure with respect to your `timeToStation` setting.

| +| `fadeUnreachableDepartures` |

A boolean value indicating whether unreachable departures should be dimmed.

**Type:** `boolean`
**Example:** `false`
**Default value:** `true`

| +| `fadeReachableDepartures` |

A boolean value indicating whether reachable departures should be faded out.

**Type:** `boolean`
**Default value:** `true`
**Possible values:** `true` and `false`

**Note:** If set to `true` departures after `fadePointForReachableDepartures` will be gradually faded out so that the last departure is barely visible.

| +| `fadePointForReachableDepartures` |

A floating point value indicating where to start the fading of departure rows.

**Type:** `float`
**Example:** `0.5` (Start fading after half of the rows.)
**Default value:** `0.25`

**Note:** This value is actually a percentage. The Default value of `0.25` denotes that after a quarter of the visible rows set by `maxReachableDepartures` the fading should start. This setting is only effective if `fadeReachableDepartures` is set to `true`.

| +| `customLineStyles` |

A string value describing the name of a custom css file.

**Type:** `string`
**Example:** `"dresden"`
**Default value:** `"leipzig"`

**Note:** If the setting `showColoredLineSymbols` is `true` the module will try to use colored labels for the line name. Per default it uses the colors used in Leipzig. This style works best if `showOnlyLineNumbers` is set to `true`. If it doesn’t suit your taste you can provide your own settings. See [Providing a custom css file](#providing-a-custom-css-file).

| +| `showOnlyLineNumbers` |

A boolean value denoting whether the line name should be displayed as a number only or the full name should be used.

**Type:** `boolean`
**Default value:** `false`
**Possible values:** `true` and `false`

**Note:** If set to `true` the module will try to separate line numbers from the line name and display only these. If the line name is “STR 11” only “11” will be displayed. This only works if there are blanks present in the line name. This setting is only tested with departures in Leipzig. If you encounter problems [let me know](https://github.com/KristjanESPERANTO/MMM-PublicTransportHafas/issues).

| +| `displayLastUpdate` |

If true this will display the last update time at the end of the task list. See screenshot above

**Type:** `boolean`
**Default value:** `true`
**Possible values:** `true` and `false`

| +| `displayLastUpdateFormat` |

Format to use for the time display if displayLastUpdate:true

**Type:** `string`
**Example:** `'HH:mm:ss'`
**Default value:** `'dd - HH:mm:ss'`

See [Moment.js formats](http://momentjs.com/docs/#/parsing/string-format/) for the other format possibilities.

| +| `animationSpeed` |

Speed of the update animation.

**Type:** `integer`
**Possible values:** `0` - `5000`
**Default value:** `2000`
**Unit:** `milliseconds`

| Here is an example for an entry in `config.js`