Giter Site home page Giter Site logo

mmm-openinghours's People

Contributors

arthurlutz avatar dependabot[bot] avatar ferferga avatar menturan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mmm-openinghours's Issues

Add a step-by-step guide

I've tried to work out how to get this working but having no luck can someone write a step by step as this look really coom just can't get it to run

Alias for long names

Awesome module, thanks for coding it!

Some places have quite long names. Suggestion to add optional "alias" for each PlaceID in the config.
If no "alias" is provided, the full name will be used.

Thanks in advance.

BR
Tilly

errors after installing

$ cd MagicMirror/modules
$ git clone https://github.com/Menturan/MMM-OpeningHours.git

after them i got following errors:

0|MagicMir | App threw an error during load 0|MagicMir | Error: Cannot find module '@google/maps' 0|MagicMir | at Module._resolveFilename (internal/modules/cjs/loader.js:602:15) 0|MagicMir | at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12) 0|MagicMir | at Function.Module._load (internal/modules/cjs/loader.js:528:25) 0|MagicMir | at Module.require (internal/modules/cjs/loader.js:658:17) 0|MagicMir | at require (internal/modules/cjs/helpers.js:20:18) 0|MagicMir | at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-OpeningHours/node_helper.js:3:14) 0|MagicMir | at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-OpeningHours/node_helper.js:133:3) 0|MagicMir | at Module._compile (internal/modules/cjs/loader.js:711:30) 0|MagicMir | at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10) 0|MagicMir | at Module.load (internal/modules/cjs/loader.js:620:32) 0|MagicMir | Whoops! There was an uncaught exception... 0|MagicMir | { Error: Cannot find module '@google/maps' 0|MagicMir | at Module._resolveFilename (internal/modules/cjs/loader.js:602:15) 0|MagicMir | at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12) 0|MagicMir | at Function.Module._load (internal/modules/cjs/loader.js:528:25) 0|MagicMir | at Module.require (internal/modules/cjs/loader.js:658:17) 0|MagicMir | at require (internal/modules/cjs/helpers.js:20:18) 0|MagicMir | at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-OpeningHours/node_helper.js:3:14) 0|MagicMir | at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-OpeningHours/node_helper.js:133:3) 0|MagicMir | at Module._compile (internal/modules/cjs/loader.js:711:30) 0|MagicMir | at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10) 0|MagicMir | at Module.load (internal/modules/cjs/loader.js:620:32) code: 'MODULE_NOT_FOUND' }

anybody knows whats wrong?

Provide own list of places

I would be nice if you could use this module without having to go through Google Places API.

In the config, provide a list of places.
The esiest would be to mimic the Places API response.

confg: {
ownProvidedPlaces: [{
"name": "My Place",
    "opening_hours": {
      "open_now": false,
      "periods": [
        {
          "close": {
            "day": 0,
            "time": "2200"
          },
          "open": {
            "day": 0,
            "time": "0800"
          }
        },
    ]
 }
}]
}

Errors with more than one place

After verifying for weeks that there is no limitation going with the Google API, it seems that there are some issues while getting more than one place using this module. It gets stuck in a infinite "Loading..." state

I found some 403 errors in the logs while running this at the beginning, but I upgraded to a Premium account in Google and it seems that the errors are still going on. Here are the logs that appear when starting MagicMirror through npm start (hiding places names):

[19:53:38] - DEBUG - MMM-OpeningHours : Response -  { status: 200,
  headers:
   { 'content-type': 'application/json; charset=UTF-8',
     date: 'Sun, 19 May 2019 17:53:38 GMT',
     expires: 'Sun, 19 May 2019 17:58:38 GMT',
     'cache-control': 'public, max-age=300',
     server: 'scaffolding on HTTPServer2',
     'x-xss-protection': '0',
     'x-frame-options': 'SAMEORIGIN',
     'server-timing': 'gfet4t7; dur=118',
     'alt-svc': 'quic=":443"; ma=2592000; v="46,44,43,39"',
     'accept-ranges': 'none',
     vary: 'Accept-Encoding',
     connection: 'close' },
  json:
   { html_attributions: [],
     result: { name: 'X', opening_hours: [Object] },
     status: 'OK' },
  requestUrl:
   'https://maps.googleapis.com/maps/api/place/details/json?fields=name%2Copening_hours&language=es&placeid=ChIJAWUYvG5sEg0RNC_oa2_gxxx&key=[HIDDEN]',
  query:
   { fields: 'name,opening_hours',
     language: 'es',
     placeid: 'ChIJAWUYvG5sEg0RNC_oa2_XXXX',
     key: '[HIDDEN]' } }
[19:53:38] - DEBUG - MMM-OpeningHours : Response.json.result -  { name: SOMEPLACE',
  opening_hours:
   { open_now: true,
     periods:
      [ [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object] ],
     weekday_text:
      [ 'lunes: 13:00–24:00',
        'martes: 13:00–24:00',
        'miércoles: 13:00–24:00',
        'jueves: 13:00–24:00',
        'viernes: 13:00–24:00',
        'sábado: 13:00–24:00',
        'domingo: 13:00–24:00' ] } }
[19:53:38] - DEBUG - MMM-OpeningHours : Response -  { status: 200,
  headers:
   { 'content-type': 'application/json; charset=UTF-8',
     date: 'Sun, 19 May 2019 17:53:38 GMT',
     expires: 'Sun, 19 May 2019 17:58:38 GMT',
     'cache-control': 'public, max-age=300',
     server: 'scaffolding on HTTPServer2',
     'x-xss-protection': '0',
     'x-frame-options': 'SAMEORIGIN',
     'server-timing': 'gfet4t7; dur=120',
     'alt-svc': 'quic=":443"; ma=2592000; v="46,44,43,39"',
     'accept-ranges': 'none',
     vary: 'Accept-Encoding',
     connection: 'close' },
  json:
   { html_attributions: [],
     result: { name: 'Lidl', opening_hours: [Object] },
     status: 'OK' },
  requestUrl:
   'https://maps.googleapis.com/maps/api/place/details/json?fields=name%2Copening_hours&language=es&placeid=ChIJXQ1XuWpsEg0RkbqBx1XXXX&key=[HIDDEN]',
  query:
   { fields: 'name,opening_hours',
     language: 'es',
     placeid: 'ChIJXQ1XuWpsEg0RkbqBx1OXXXX',
     key: '[HIDDEN]' } }
[19:53:38] - DEBUG - MMM-OpeningHours : Response.json.result -  { name: 'Lidl',
  opening_hours:
   { open_now: false,
     periods:
      [ [Object], [Object], [Object], [Object], [Object], [Object] ],
     weekday_text:
      [ 'lunes: 9:00–21:30',
        'martes: 9:00–21:30',
        'miércoles: 9:00–21:30',
        'jueves: 9:00–21:30',
        'viernes: 9:00–21:30',
        'sábado: 9:00–21:30',
        'domingo: Cerrado' ] } }
[19:53:38] - DEBUG - MMM-OpeningHours : Response -  { status: 200,
  headers:
   { 'content-type': 'application/json; charset=UTF-8',
     date: 'Sun, 19 May 2019 17:53:38 GMT',
     expires: 'Sun, 19 May 2019 17:58:38 GMT',
     'cache-control': 'public, max-age=300',
     server: 'scaffolding on HTTPServer2',
     'x-xss-protection': '0',
     'x-frame-options': 'SAMEORIGIN',
     'server-timing': 'gfet4t7; dur=208',
     'alt-svc': 'quic=":443"; ma=2592000; v="46,44,43,39"',
     'accept-ranges': 'none',
     vary: 'Accept-Encoding',
     connection: 'close' },
  json:
   { html_attributions: [],
     result: { name: 'SOMEPLACE', opening_hours: [Object] },
     status: 'OK' },
  requestUrl:
   'https://maps.googleapis.com/maps/api/place/details/json?fields=name%2Copening_hours&language=es&placeid=ChIJQQDaGGxsEg0RNILE38XXXXX&key=[HIDDEN]',
  query:
   { fields: 'name,opening_hours',
     language: 'es',
     placeid: 'ChIJQQDaGGxsEg0RNILE38XXXXX',
     key: '[HIDDEN]' } }
[19:53:38] - DEBUG - MMM-OpeningHours : Response.json.result -  { name: 'SOMEPLACE',
  opening_hours:
   { open_now: false,
     periods:
      [ [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object] ],
     weekday_text:
      [ 'lunes: Cerrado',
        'martes: 13:00–16:00, 20:30–23:00',
        'miércoles: 13:00–16:00, 20:30–23:00',
        'jueves: 13:00–16:00, 20:30–23:00',
        'viernes: 13:00–16:00, 20:30–23:00',
        'sábado: 13:00–16:00, 20:30–23:00',
        'domingo: 13:00–16:00' ] } }
[19:53:38] - DEBUG - MMM-OpeningHours : Response -  { status: 200,
  headers:
   { 'content-type': 'application/json; charset=UTF-8',
     date: 'Sun, 19 May 2019 17:53:38 GMT',
     expires: 'Sun, 19 May 2019 17:58:38 GMT',
     'cache-control': 'public, max-age=300',
     server: 'scaffolding on HTTPServer2',
     'x-xss-protection': '0',
     'x-frame-options': 'SAMEORIGIN',
     'server-timing': 'gfet4t7; dur=106',
     'alt-svc': 'quic=":443"; ma=2592000; v="46,44,43,39"',
     'accept-ranges': 'none',
     vary: 'Accept-Encoding',
     connection: 'close' },
  json:
   { html_attributions: [],
     result: { name: 'SOMEPLACE', opening_hours: [Object] },
     status: 'OK' },
  requestUrl:
   'https://maps.googleapis.com/maps/api/place/details/json?fields=name%2Copening_hours&language=es&placeid=ChIJx5EBKW9sEg0RjZQlE_XXXXX&key=[HIDDEN]',
  query:
   { fields: 'name,opening_hours',
     language: 'es',
     placeid: 'ChIJx5EBKW9sEg0RjZQlE_XXXX',
     key: '[HIDDEN]' } }
[19:53:38] - DEBUG - MMM-OpeningHours : Response.json.result -  { name: 'SOMEPLACE',
  opening_hours:
   { open_now: true,
     periods:
      [ [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object] ],
     weekday_text:
      [ 'lunes: 13:00–24:00',
        'martes: 20:00–24:00',
        'miércoles: 13:00–24:00',
        'jueves: 13:00–24:00',
        'viernes: 13:00–0:30',
        'sábado: 13:00–0:30',
        'domingo: 13:00–24:00' ] } }
[19:53:38] - DEBUG - MMM-OpeningHours : Response -  { status: 200,
  headers:
   { 'content-type': 'application/json; charset=UTF-8',
     date: 'Sun, 19 May 2019 17:53:38 GMT',
     expires: 'Sun, 19 May 2019 17:58:38 GMT',
     'cache-control': 'public, max-age=300',
     server: 'scaffolding on HTTPServer2',
     'x-xss-protection': '0',
     'x-frame-options': 'SAMEORIGIN',
     'server-timing': 'gfet4t7; dur=188',
     'alt-svc': 'quic=":443"; ma=2592000; v="46,44,43,39"',
     'accept-ranges': 'none',
     vary: 'Accept-Encoding',
     connection: 'close' },
  json:
   { html_attributions: [],
     result: { name: 'SOMEPLACE', opening_hours: [Object] },
     status: 'OK' },
  requestUrl:
   'https://maps.googleapis.com/maps/api/place/details/json?fields=name%2Copening_hours&language=es&placeid=ChIJNYda7WtsEg0RCC83FLkXXXX&key=[HIDDEN]',
  query:
   { fields: 'name,opening_hours',
     language: 'es',
     placeid: 'ChIJNYda7WtsEg0RCC83FLkXXXX',
     key: '[HIDDEN]' } }
[19:53:38] - DEBUG - MMM-OpeningHours : Response.json.result -  { name: 'SOMEPLACE',
  opening_hours:
   { open_now: false,
     periods:
      [ [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object] ],
     weekday_text:
      [ 'lunes: 6:00–23:00',
        'martes: 6:00–23:00',
        'miércoles: 6:00–23:00',
        'jueves: 6:00–23:00',
        'viernes: 6:00–23:00',
        'sábado: 9:00–21:00',
        'domingo: 9:00–15:00' ] } }
[19:53:38] - DEBUG - MMM-OpeningHours : Response -  { status: 200,
  headers:
   { 'content-type': 'application/json; charset=UTF-8',
     date: 'Sun, 19 May 2019 17:53:38 GMT',
     expires: 'Sun, 19 May 2019 17:58:38 GMT',
     'cache-control': 'public, max-age=300',
     server: 'scaffolding on HTTPServer2',
     'x-xss-protection': '0',
     'x-frame-options': 'SAMEORIGIN',
     'server-timing': 'gfet4t7; dur=96',
     'alt-svc': 'quic=":443"; ma=2592000; v="46,44,43,39"',
     'accept-ranges': 'none',
     vary: 'Accept-Encoding',
     connection: 'close' },
  json:
   { html_attributions: [],
     result: { name: 'Burger King' },
     status: 'OK' },
  requestUrl:
   'https://maps.googleapis.com/maps/api/place/details/json?fields=name%2Copening_hours&language=es&placeid=ChIJ4Wft4C9tEg0Rlp6tR1XXXX&key=[HIDDEN]',
  query:
   { fields: 'name,opening_hours',
     language: 'es',
     placeid: 'ChIJ4Wft4C9tEg0Rlp6tR14XXXX',
     key: '[HIDDEN]' } }
[19:53:38] - DEBUG - MMM-OpeningHours : Response.json.result -  { name: 'Burger King' }
[19:53:38] - DEBUG - MMM-OpeningHours : Sending to frontend -  [ { name: 'Someplace',
    opening_hours: { open_now: true, periods: [Array], weekday_text: [Array] } },
  { name: 'Lidl',
    opening_hours: { open_now: false, periods: [Array], weekday_text: [Array] } },
  { name: 'Someplace',
    opening_hours: { open_now: false, periods: [Array], weekday_text: [Array] } },
  { name: 'someplace',
    opening_hours: { open_now: true, periods: [Array], weekday_text: [Array] } },
  { name: 'someplace',
    opening_hours: { open_now: false, periods: [Array], weekday_text: [Array] } },
  { name: 'Burger King' } ]

I use the same API key in other modules, it's that an issue? I hope not, as everything looks good in my side and the module works flawlessly with only one place configured.

Support for OpenStreetMap opening_hours

I'm sorry if this is totally out of topic, feel free to shut this issue if this is the case.

I'm looking for the functionality of this plugin but without using google's data or API. I'd be interested in extracting the data from the OSM geographical database https://www.openstreetmap.org/ In OSM the opening_hours tag is documented here : https://wiki.openstreetmap.org/wiki/Key:opening_hours and I have found a javascript library which could be of some help to add support here (or a separate plugin) : https://github.com/AMDmi3/opening_hours.js

Does that seem feasible ? reasonable ? a completely different plugin ? does it already exist elsewhere ?

I'd be happy to help out but have little skills in javascript, and no idea (yet) on how much time I'd be ready to put into this (I've just started building a mirror, so not sure yet).

Thanks for your feedback.

Upgrade opening_hours dependency ?

OpeningHours doesn't display anymore for me. I get :

[11.11.2022 11:43.03.691] [ERROR] An error occurred during evaluation of the value "Tu 16:15-18:30, We 10:00-12:30, We 13:30-18:30, Th 16:15-18:30, Fr 16:15-18:30, Sa 10:00-12:30, Sa 13:30-17:00; PH off; SH Tu 16:00-18:30, We 10:00-12:00, We 13:30-18:30, Th 10:00-12:00, Th 16:00-18:30, Fr 16:00-18:30". Please submit a pull request: https://github.com/opening-hours/opening_hours.js. School holiday not defined for the year 2022.

I think opening_hours should be upgraded ?

It seems that holidays for 2022 are in https://github.com/opening-hours/opening_hours.js/blob/master/src/holidays/fr.yaml#L390

But maybe this is not included in the 3.7.0 release https://github.com/opening-hours/opening_hours.js/releases ?

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.