Giter Club home page Giter Club logo

mmm-fuel's Introduction

GitHub license Build Status Code Climate Known Vulnerabilities

MMM-Fuel

Gas Station Price Module for MagicMirror2

Examples

Dependencies

Installation

  • Clone this repo into ~/MagicMirror/modules directory.
  • Configure your ~/MagicMirror/config/config.js:
{
    module: "MMM-Fuel",
    position: "top_right",
    config: {
        api_key: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        lat: 52.518611,
        lng: 13.408333,
        types: ["diesel"],
        // all your config options, which are different than their default values
    }
}
  • Run command npm i --production in ~/MagicMirror/modules/MMM-Fuel directory.

Config Options

Option Default Description
provider "tankerkoenig" API provider (See full list below).
lat REQUIRED Decimal degrees latitude.
lng REQUIRED Decimal degrees longitude.
types ["diesel"] Fuel types in an array e.g. ["diesel", "e5"]. All valid types can be seen in the specific provider section below.
sortBy "diesel" Price sorting by which fuel type defined in config option types.
open false Display whether the gas station is open or not.
radius 5 Lookup Area for Gas Stations in km.
max 5 How many gas stations should be displayed.
map_api_key false Required to show the gas stations map with traffic layer. You can get it here and don't forget to activate maps api for javascript.
zoom 12 Zoom of the map. (Min 0, Max 18 depends on the area)
height 600 Height of the map in pixel.
width 600 Width of the map in pixel.
colored false Boolean to show the gas stations map colored or not.
shortenText false Integer of characters to be shown for name and address. Default shows all.
showAddress true Boolean to show the gas stations address.
showOpenOnly false Boolean to show only open gas stations or all.
showDistance true Boolean to show the distance to your specified position.
iconHeader true Boolean to display the car icon in the header.
rotate true Boolean to enable/disable rotation between sort by price and distance.
rotateInterval 60000 (1 min) How fast the sorting should be switched between byPrice and byDistance.
updateInterval 900000 (15 mins) How often should the data be fetched. If your value is to small, you risk to get banned from the API provider. I suggest a minimum of 15mins

tankerkoenig (Germany only)

Read the Terms of Use carefully, especially the restrictions for smart mirrors, or your API access will be suspended.

Option Default Description
api_key REQUIRED Get an API key for free access to the data of tankerkoenig.de.
types ["diesel"] Valid options are diesel, e5 and e10.
radius 5 Valid range is 1-25.

spritpreisrechner (Austria only)

No API key required.

Option Default Description
types ["diesel"] Valid options are diesel, e5 and gas.
radius 5 Valid range not tested yet.
max 5 The API provider returns maximum of 5 valid datasets.

nsw (Australia NSW only)

This provider gives no information if the gas stations are open or closed. Config options should be set accordingly open: false and showOpenOnly: false.

Option Default Description
api_key REQUIRED Get an API key for free access to the data of api.nsw.
secret REQUIRED You also need to add the secret visible in your dashboard on api.nsw.
types ["diesel"] Valid options are diesel, e5.
radius 5 Valid range not tested yet.

OPTIONAL: Voice Control and Modal

This module supports voice control by MMM-voice and MMM-Modal. In order to use this feature, it's required to install the voice and modal modules. There are no extra config options for voice control and modals needed.

Mode

The voice control mode for this module is FUEL

List of all Voice Commands

  • OPEN HELP -> Shows the information from the readme here with mode and all commands.
  • CLOSE HELP -> Hides the help information.
  • SHOW GAS STATIONS MAP -> Shows a map with the gas stations labeled by Price starting with 1.
  • HIDE GAS STATIONS MAP -> Hide the map.

Developer

  • npm run lint - Lints JS and CSS files.
  • npm run docs - Generates documentation.

API Provider Development

If you want to add another API provider checkout the Guide.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.