Skip to content
Magic Mirror module that displays places opening hours.
JavaScript
Branch: master
Clone or download

README.md

MMM-OpeningHours - WIP

David 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 place id 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.

Styling

Key Value Required Default Description
showTimeUntil boolean No true 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"],
        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

You can’t perform that action at this time.