ryck / MMM-TFL-Arrivals

MIT License
5 stars 2 forks source link

MMM-TFL-Arrivals

This a module for the MagicMirror.

This module gets real time arrival predictions for specific stops using the TfL API.

Installation

git clone https://github.com/ryck/MMM-TFL-Arrivals.git &&
cd MMM-TFL-Arrivals &&
npm install

Config

The entry in config.js can include the following options:

Option Description
app_id Required This is the App ID assigned to you on the TfL Open Data Portal. Details on how to request an App ID can be found here

Type: string
app_key Required This is the App key assigned to you on the TfL Open Data Portal. Details on how to request an App key can be found here

Type: string
naptanId Required A StopPoint id (station naptan code e.g. 940GZZLUAS). You can search for StopPoints IDs here

Type: string
updateInterval How often the arrival information is updated.

Type: integer
Default value: 1 min
fade Fade the future events to black. (Gradient)

Type: bool
Possible values: true or false
Default value: true
fadePoint Where to start fade?

Type: bool
Possible values: 0 (top of the list) - 1 (bottom of list)
Default value: 0.25
initialLoadDelay The initial delay before loading. If you have multiple modules that use the same API key, you might want to delay one of the requests. (Milliseconds)

Type: integer
Possible values: 1000 - 5000
Default value: 0
animationSpeed Speed of the update animation. (Milliseconds)

Type: integer
Possible values:0 - 5000
Default value: 2000 (2 seconds)
lateThreshold How many minutes is late?

Type: integer
Default value: 2 min
limit Number of departures to return.

Type: string
Default: 5
color Use some accent colors for due and late status

Type: bool
Possible values: true or false
Default value: true
debug Show debug information.

Possible values: true or false
Default value: false

Here is an example of an entry in config.js

{
    module: 'MMM-TFL-Arrivals',
    position: 'bottom_left',
    header: 'Bus Arrivals',
    config: {
        app_id: "$APPID",
        app_key: "$APPKEY",
        naptanId: "940GZZLUBLM", // StopPoint id
        animationSpeed: 1000,
        fade: true,
        fadePoint: 0.25, // Start on 1/4th of the list.
        limit: 5,
        initialLoadDelay: 0,
        color: true,
        debug: false
    }
},

Dependencies

Thanks To...