k-0 / MMM-Canteen

This MagicMirror module shows the menu including the prices of canteens from universities in germany and switzerland (based on openmensa.org API).
MIT License
4 stars 5 forks source link

Multiple instances of module not working #4

Open Patschke opened 3 years ago

Patschke commented 3 years ago

I tried to use the following config

        {
                module: 'MMM-Canteen',
                position: 'right',
                config: {
                            canteenName: 'Mensa',
                            updateInterval: 600000,     
                            canteen: 361,                        
                            status: "students",               
                            truncate: 100,                                      
                            switchTime: "14:00"                
                        }
        },
        {
                module: 'MMM-Canteen',
                position: 'right',
                config: {
                            canteenName: 'Atrium',
                            updateInterval: 600000,     
                            canteen: 1091,                        
                            status: "students",               
                            truncate: 100,                                      
                            switchTime: "14:00"                
                        }
        },

to get both of our Mensa shown (TU Kaiserslautern). However, it will just show the menu of the first Mensa encountered in the config twice (once with the name "Mensa", once with the name "Atrium"). I also tried with different canteen id (e.g. showing our Mensa and the Mensa am Park, Leipzig) with the same result: The first mensa is shown twice.

Am I doing something wrong with the config, or is this modules currently not working with more than one instance at the same time?

KristjanESPERANTO commented 1 year ago

My fork (https://github.com/KristjanESPERANTO/MMM-Canteen) supports multiple instances as of today. I would appreciate feedback :slightly_smiling_face: But there is currently no data from your two canteens.

Patschke commented 1 year ago

Thanks for the info. As you also already noticed our canteen sadly stopped working with OpenMensa, so I'd have to write my own parser from the mensa site to OpenMensa if I want to use this - perhaps I'll do at some point, in that case I'd also try out your fork.

KristjanESPERANTO commented 1 year ago

Before you write your own parser, open an issue or create a PR for the current parser: https://github.com/cvzi/mensa

Patschke commented 1 year ago

I can surely open an issue there, true. In case nobody else want's to update the parser I can still do it myself and add a PR later...

KristjanESPERANTO commented 1 year ago

Since they fixed the parser it works now with my fork :slightly_smiling_face:

If you can confirm that, I suggest closing this issue here.

Patschke commented 1 year ago

Yep, works now as expected after changing to your fork. Thanks for taking over in maintaining this!

Patschke commented 1 year ago

Well, guess I was too fast in closing this. After a day both modules show the same canteen again. Restarting MagicMirror fixes this, but is not what one wants to do each day.