Skip to content

lakellie/MagicMirror-LocalTransport-Module

 
 

Repository files navigation

MagicMirror-LocalTransport-Module

Status-BETA License

This module display the next local transport connection between an origin and destination.

preview

Installation

Go to your MagicMirror folder.

cd MagicMirror

Clone the repository.

git clone https://github.com/CFenner/MagicMirror-LocalTransport-Module.git modules/localtransport

Configuration

Add module configuration to config.js.

{
  module: 'localtransport',
  position: 'ANY_POSITION',
  config: {
    api_key: 'YOUR_API KEY',
    origin: 'YOUR_ORIGIN',
    destination: 'YOUR_DESTINATION'
  }
},
Option Description
apiKey The API key, which can be obtained here.

This value is REQUIRED
origin The start location.

Example: Mannheim HBF
This value is REQUIRED
destination The target location.

Example: Frankfurt HBF
This value is REQUIRED
maximumEntries Maximum number of routes to display. Less routes will be shown if less are returned by Google. Routes will be sorted by arrival time. This option should take an integer value between 1 and 5.

Default value: 3
updateInterval How often does the content need to be fetched? (Minutes) Note that the module refreshes every 15 seconds to always display an accurate estimate when you need to leave.

Default value: 5
animationSpeed Speed of the update animation. (Seconds)

Default value: 1
displayStationLength Number of characters of the departure station for each transport mode to display.
0 means display all,
-1 means don't show the departure station

Default value: 0
displayArrival Boolean if the arrival time should be shown in the header for each option.

Default value: true
displayWalkType String how detailed the walking segments should be shown.
'none' means to not display anything,
'short' means to display the symbol, the time and the short version of the unit or
'long' means that a symbol, the time and the long string for the unit is displayed. This options is default if an invalid string is supplied.

Default value: 'short'
maxWalkTime Maximum time you are willing to walk between stations in minutes

Default value: 10
maxModuleWidth Maximum width of the module in pixel. Unlimited when set to 0. This option can be used to make the module shorter in case of very long lines for directions.

Default value: 0
fade Boolean if a fade should be applied - same as for calendar module

Default value: true
fadePoint Percentage, where the fade should start. This should be a value between 0 and 1 - same as for calendar module

Default value: 0.1
language Language to display information in - german de or english en

Default value is same as defined in the main config file
units Units to use - metric or imperial

Default value is same as defined in the main config file
timeFormat 24 or 12 hour clock for displaying the arrival time

Default value is same as defined in the main config file

Preview of various settings

{
  module: 'localtransport',
  header: 'to Victoriy Coach Station',
  position: 'top_left',
  config: {
    api_key: 'MYG00GLEAP1KEY',
    origin: 'Waterloo Station, London, United Kingdom',
    destination: 'Victoria Coach Station, London, United Kingdom',
    maximumEntries: 4,
    maxWalkTime: 15,
    displayWalkType: 'full',
    maxModuleWidth: 400
  }
},

London - left long block

{
  module: 'localtransport',
  header: 'nach Berlin',
  position: 'top_right',
  config: {
    api_key: 'MYG00GLEAP1KEY',
    origin: 'Bahnhof Hamburg Altona, Hamburg, Germany',
    destination: 'Berlin Hauptbahnhof, Berlin, Germany',
    maximumEntries: 6,
    maxWalkTime: 15,
    displayStationLength: -1,
    displayWalkType: 'none',
    displayArrival: false,
    language: 'de'
  }
},

Berlin - right short

{
  module: 'localtransport',
  header: 'to Museum of Art',
  position: 'top_left',
  config: {
    api_key: 'MYG00GLEAP1KEY',
    origin: 'MetLife Stadium, 1 MetLife Stadium Drive, East Rutherford, NJ 07073, US',
    destination: '1000 5th Ave, New York, NY 10028, US',
    maximumEntries: 3,
    maxWalkTime: 30,
    displayStationLength: 10
  }
},

New York - left

Special Thanks

Thanks to SamLewis0602 for his module MMM-Traffic by SamLewis0602 on which this one is based on.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 93.9%
  • CSS 6.1%