bureus / MMM-Vasttrafik-PublicTransport

Initial commit
9 stars 6 forks source link

Trouble only viewing one track at a stop #11

Closed graaahn closed 4 years ago

graaahn commented 4 years ago

Hi,

Super nice module! When retrieving the track id's, I am only choosing the ID for track A at my stop, but the module is still showing all tracks.. Have I done anyting wrong? Or is choosing only one track not possible?

BR Grahn

bureus commented 4 years ago

@graaahn : Thanks for your kind words. That's currently not supported by the module. But I can easily fix it. So give me a couple of hours and a new patch will be released so that you can filter board based on track :)

bureus commented 4 years ago

@graaahn : So I have released a feature now that allows you to filter on "track", "direction", "line" or "type". This will give you that possibility to only show track = A or line = 2 for example. So dont use any track id or similar, just use the normal stopId and configurations to the module.

In order to get this to work, you first need to update the module, see section "Update". After that has been completed you need to change your configs according to specifications described in section "Configuration". See filterAttr and filterKey. Examples of how to do that is added under section "Filtered board".

So in short your config should look something like this: { module: "MMM-Vasttrafik-PublicTransport", position: "bottom_left", header: "Västtrafik", config: { stopIds: ["your_stop_ids"], appKey: "your_app_key", appSecret: "your_app_secret", debug: false, sortBy: "track", refreshRate: "20000", trafficSituations: true, filterAttr: "track", filterKey: "A" } }, Please reach out again if it dosent work :)

graaahn commented 4 years ago

Thank you so much! Works perfectly now!

Gnarga commented 4 years ago

When filtering on type, is it "train", "bus" and so on? And filtering on direction? Trying to filter to only show trains from Trollhättan Resecentrum to Göteborg Central, any help would be appreciated!