GithubHelp home page GithubHelp logo

joelgeiser / mmm-openinghours Goto Github PK

View Code? Open in Web Editor NEW

This project forked from menturan/mmm-openinghours

0.0 0.0 0.0 1.14 MB

Magic Mirror module that displays places opening hours.

License: GNU General Public License v3.0

JavaScript 100.00%

mmm-openinghours's Introduction

MMM-OpeningHours - WIP

Known Vulnerabilities LGTM Alerts LGTM Grade Yarn

Say Thanks! Maintenance GitHub commit activity GitHub License

Note! This module is still under development! Things such as configurations and appearance may change. Use at your own risk!

Magic Mirror module that displays places opening hours. Relies on Google Places API.

Screenshot

Screenshot

Prerequisite

You need to have a Google Places API key to use this module. Follow their guide here: Get API Key.

NOTE! The opening hours field in Google Places API is a billed field. However, Google give you a free monthly credit. Please carefully read about their billing here. Contributors of this module is not responsible for any charges.

Install

This module uses Yarn.

  1. yarn install

Find places ID

Search for the place to get its ID. You really needs to search for a place. Clicking on a place wont cut it.

Place ID Finder

Configuration

Key Value Required Default Description
googleApiKey string Yes N/A Your Google Places API Key.
places See below. Yes N/A List of place ids. See above.
scheduleTime milliseconds No 86400000 (24h) Time between fetching place data from Google.
timeFormat number No config.timeFormat 24h, 12h. If not specified, uses same as parent config.
language ISO 639-1 code No config.language Changes the translation. Time and date is still locale. Two letter country code. ISO 639-1 code. If not specified, uses same as parent config.
styling object No See next table. Configure table style.
debug boolean No false Debug output.
mockData boolean No false Fake API-call. Used for development.

Places config

Places are provided as a list []. Example - ["place_id_1", "place_id_2", "place_id_3"].

If you would like to use an alias for a place you put the place id and the alias in a list with the place id first. Example - ["place_id_1", ["place_id_2", "Place 2"], "place_id_3"].

Styling

Key Value Required Default Description
showTimeUntil boolean No false Show time until close/open instead of time when closed/open.
textAlign string No center Table text alignment. Possible values: left, right, center.
size string No small Size of table. Possible values: xsmall, small, medium. large, xlarge.

Example config

{
    module: "MMM-OpeningHours",
    position: "bottom_right",
    header: "Opening hours",
    config: {
    googleApiKey: "XXXXXXXXXXXXXX",
        places: ["xxxxxxxx", ["yyyyyyyy", "Alias y"]],
        styling: {
          size: 'small'
        }
    }
}

Development

This module isn't perfect. If you find a bug or has a feature request don't hesitate to create an issue OR even better, create a pull request! :D

mmm-openinghours's People

Contributors

menturan avatar arthurlutz avatar ferferga avatar joelgeiser avatar dependabot[bot] avatar

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.