This is a traffic module for the MagicMirror. It is able to print estimated travel time in minutes from origin to destination.
Clone this repository in your modules folder, and install dependencies:
cd ~/MagicMirror/modules # adapt directory if you are using a different one
git clone https://github.com/markfodor/MMM-trafficmate.git
cd MMM-trafficmate
npm installAdd the module to your config/config.js file.
{
module: 'MMM-trafficmate',
position: 'top_right',
config: {
apiKey: '<YOUR_API_KEY>',
origin: '<ROUTE_ORIGIN>',
destination: '<ROUTE_DESTINATION>'
}
},The apiKey, origin and destination fields are mandatory.
Optional config properties
| Name | Options | Default value |
|---|---|---|
| defaultText | - | "Route duration: " |
| travleMode | "DRIVING" / "WALKING" / "BICYCLING" / "TRANSIT" | "DRIVING" |
Run the test npm script
npm test
Current Tests:
- ESLint for linting the javascript
- stylelint for linting the CSS with stylelint-config-standard as its base
- jsonlint for linting the translation files
- markdownlint for checking the markdown files (
README.md,CHANGELOG.md,LICENSE.txt) - js-yaml to lint the
.travis.yml(run through grunt-yamllint)
If it is possible it will also automatically fix some issues.
If you have any suggest, please let me know by an issue.
