Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A module for the Magic Mirror to display DC metro train arrival times for the various stations as well as any reported incidents.

License

NotificationsYou must be signed in to change notification settings

AdamMoses-GitHub/MMM-DCMetroTrainTimes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TheMMM-DCMetroTrainTimes module is a module designed to display the train arrival times as stations along the Washington Metropolitan Area Transit Authority metro system, aka the Washington DC metro system. It is configurable based on the stations to get arrival times for, destinations to exclude, coloring line codes visually, and other options.

It also will show any incidents reported by WMATA on the rail lines by listing which color lines are currently affected, i.e. Orange, Blue, Silver, etc.

Example:

FullFull

Dependencies / Requirements

This module requires access to a WMATA Developers API key. For more information on acquiring thisplease visithttps://developer.wmata.com/.

You will also need to configure the metro stations of interest to you by using the station code which are listed in the seperate./stationcodes/stationcodes.md.

NOTE: The./stationcodes/stationcodes.json file is actually used by the module so calls are not made to get it each time the module runs since the station codes and other information are rarely changed. If a problem occurs involving the codes you can run the./stationcodes/getStationCodes.js to update them.

Using the module

To use this module, add it to the modules array in theconfig/config.js file:

modules:[{module:'MMM-DCMetroTrainTimes',position:'bottom_right',config:{// visit the url below for the wmata api key// https://developer.wmata.com/wmata_api_key:'FILL IN',// use the station codes file ./stationcodes/stationcodes.md for// more on these valuesstationsToShowList:['C04','A04','D03'],}}]

Configuration options

The following properties can be configured:

OptionDescription
wmata_api_keyUsed by the module to make calls to the WMATA JSON REST API. For more visithttps://developer.wmata.com/.

This value isREQUIRED
stationsToShowListContains a JSON array of strings indicating WMATA Metro Station Code values. These are the stations you want to see train arrival times for. A table of these values can be found at./stationcodes/stationcodes.md.

Example:[ 'C04', 'A04', 'D03' ]
This value isOPTIONAL, BUT EFFECTIVELY REQUIRED
Default value:[ 'A01', 'C01' ]
showIncidentsToggle to turn on or off the incidents listing which will be shown before the train arrival times. Default is on.

Example:false
Default value:true
This value isOPTIONAL
showStationTrainTimesToggle to turn on or off the station train arrival times listing which is shown after the incidents listing. Default is on.

Example:false
Default value:true
This value isOPTIONAL
destinationsToExcludeListContains a JSON array of strings indicating WMATA Metro Station Code values. The station codes listed here will be hidden from any list of train arrivals for any of the stationsToShowList. This is useful if you live near the end of a line and aren't interested in taking trains towards your end. If left empty no destination stations will be excluded.

Example:[ 'N06', 'D13' ]
Default value:[ ]
This value isOPTIONAL
showDestinationFullNameToggle to turn on or off full destination station names. Otherwise it will be an abbreviated destination station name. Default is on (full station name).

Example:false
Default value:true
This value isOPTIONAL
refreshRateIncidentsSpecified inMILLISECONDS, sets the rate at which updates will be made to the metro incidents list. This value defaults to every two minutes. Note setting this value to low, i.e. fast, can use up a lot of alloted daily API calls so don't abuse this value. Also, incidents aren't updated nearly as often as train arrival times.

Example:6 * 60 * 1000
Default value:2 * 60 * 1000
This value isOPTIONAL
refreshRateStationTrainTimesSpecified inMILLISECONDS, sets the rate at which updates will be made to the station train arrival times list. This value defaults to every thirty seconds. Note setting this value to low, i.e. fast, can use up a lot of alloted daily API calls so don't abuse this value.

Example:1 * 60 * 1000
Default value:30 * 1000
This value isOPTIONAL
maxTrainTimesPerStationThe maximum number of train times to show per station, i.e. if you set this to 2 you would only ever get the 2 next train times for a given station. This defaults to zero which means show all the train times.

Example:3
Default value:0
This value isOPTIONAL
showHeaderToggles the header title on or off.

Example:false
Default value:true
This value isOPTIONAL
headerTextThe text to display in the header title.

Example:"WMATA Train Arrival Times"
Default value:"DC Metro Train Times"
This value isOPTIONAL
limitWidthThe width of cell containing the incident list, usually the widest cell. It effectively limits the total width of this module. Usually specified in pixels but can specified in any HTML width style. Specified as a string.

Example:"350px"
Default value:"200px"
This value isOPTIONAL
colorizeLinesToggle this to enable colorzing any train line code or name by it's color, i.e. the Orange Line 'OR' will be colored orange, the Blue Line 'BL' will be colored blue, etc. Defaults to off to fit with the usual Magic Mirror look.

Example:true
Default value:false
This value isOPTIONAL
incidentCodesOnlyToggle to change from the full text of the lines with incidents to just showing line codes, i.e. "Incident Reported On The Orange Line" as opposed to just showing "OR". Turned off by default to do a full-text listing of lines with incidents on them.

Example:true
Default value:false
This value isOPTIONAL
hideTrainTimesLessThanWill exclude listing trains that are arriving in time less the specified amount inMINUTES. This is useful if for instance it took your four minutes to walk to your station so showing trains arriving less than four minutes would be useful. Note that is processed before maxTrainTimesPerStation. This defaults to zero which disables it.

Example:4
Default value:0
This value isOPTIONAL

About

A module for the Magic Mirror to display DC metro train arrival times for the various stations as well as any reported incidents.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp