qistoph / MMM-nstreinen

MagicMirror² module to show Dutch train information
12 stars 4 forks source link

show one trip only. #1

Closed MrPineMan closed 7 years ago

MrPineMan commented 7 years ago

Is it possible to only show the train from location A to B instant of every train from location A ? is het mogelijk alleen 1 traject te laten zien? For example / voorbeeld: Utrecht > Heerlen 10.00 Utrecht > Maastricht 10.15 Utrecht > Maastricht 10.30 +3

qistoph commented 7 years ago

Not yet, but I see why that would be handy for a big station like Utrecht. I'll try to implement it. Keep an eye on this issue

MrPineMan commented 7 years ago

Thanks! IT Sounds great already. My Programming skills aren't 10/10 but tell me if im able to help you

qistoph commented 7 years ago

Have a look at the new develop branch.

I have included a configuration option destination. If it is configured the route planning API from NS is used to plan a route from station to destination. Your mirror will then show the types of trains in your trip (intercity/sprinter), the total trip time, the departure time and the track the first train is leaving from.

MrPineMan commented 7 years ago

Wow great! Im able to test it tomorrow! Thanks anyways!

MrPineMan commented 7 years ago

Hi sorry for the late reply. I tryed alot but it didnt work for me yet.

First at all I removed the old folder. Cloned the develop git runned the commmand npm install in the NStreinen directory which installed all the dependencies.

The names were a bit confusing, the git MMM-nstreinen and the folder which is used without MMM.

Used the following line in my config.js


 {
                        module: 'nstreinen',
                        position: 'top_right',
                        classes: 'default',
                        header: 'UTRECHT - EINDHOVEN',
                                config: {
                                user: 'email',
                                pass: 'apikey',
                                station: 'Utrecht Central',
                                destination: 'Eindhoven Centraal'
                        }
                },

Without destination it works well, but when i add the destination line it shows nothing :( The line classes: '', is used for my facial recognition just ignore it 💃

qistoph commented 7 years ago

As instructed in the README, you should clone using git clone <URL> nstreinen to have it cloned in the right folder (without MMM-). I use the MMM prefix for my repos, but really don't like the prefix in my modules folder. It's also not in line with the names of the default modules.

After making two changes to your config, I did get it to run:

station: 'Utrecht centraal` // with two a's
destination: `Eindhoven` // without Centraal

The names should match the exact name as used by NS on the reisplanner. You could see the errors on the client-side javascript log, if you view it from a remote browser.

Maybe I could update the code to show an error instead of the text 'loading...'

MrPineMan commented 7 years ago

capture

 {
                        module: 'nstreinen',
                        position: 'top_right',
                        header: 'UTRECHT - EINDHOVEN',
                                config: {
                                user: 'personal email',
                                pass: 'API key',
                                maxEntries:'10',
                                station: 'Utrecht centraal',
                                destination: 'Eindhoven'
                        }
                },

with this code is the following shown( see image ) I doesn't work how it should imo, because rotterdam, amsterdam, den haag, den helden, baarn, amersfoort, tiel aren't related

qistoph commented 7 years ago

Did you checkout the develop branch?

git clone -b develop <URL> nstreinen

MrPineMan commented 7 years ago

No, i'm new with that function / command. Ill test it asap.

qistoph commented 7 years ago

Hi @Labzz, did you manage to test it? Does it work?

MrPineMan commented 7 years ago

Hi, I'm so sorry, totally forgot to write you back. I'll test it this week and let you know!

MrPineMan commented 7 years ago

Worked for me 👍