fewieden / MMM-WienerLinien

Public Transport Module of Vienna/Austria for MagicMirror²
MIT License
25 stars 4 forks source link

incidentLines filter is not working #13

Closed fewieden closed 4 years ago

fewieden commented 4 years ago

@bblaha: incidentLines was - from my understanding - supposed to act as a filter for which lines to show in the Incidents section. Upon filling the variable, ALL incidents showed up unfiltered, thus cluttering the screen.

@fewieden: @bblaha would you mind showing your config without the API key? This should already be handled in the node helper https://github.com/fewieden/MMM-WienerLinien/blob/3eec0637f98ecd2ac1d4aba33a98040f21227b37/node_helper.js#L63

@bblaha: Sure:


{
module: "MMM-WienerLinien",
position: "top_left",
config: {
api_key: "XXX",
stations: ["1266", "1259"],
updateInterval:"60000",
rotateInterval:"5000",
incidentLines:["35A","39A","U4","U6"],
shortenDestination:"12",
}
},

> Without my change the above config shows ALL incidents of all line. I have tried entering the line name, the line ID according to the Wiener Linien API and everything else I could think of (Documentation is not really clear on what it expects here). Output was always ALL incidents.

Extracted from https://github.com/fewieden/MMM-WienerLinien/pull/12
fewieden commented 4 years ago

@bblaha I played a little bit with your configuration and it seems like the related lines filter is broken on the API only for type stoerunglang, for stoerungkurz it is filtering properly.

I will contact them about this issue.

Additionally, I found out that there is also a bug in my module, which makes it impossible to only show stoerungkurz. I will push a fix to the branch develop for this. https://github.com/fewieden/MMM-WienerLinien/blob/3eec0637f98ecd2ac1d4aba33a98040f21227b37/node_helper.js#L60

fewieden commented 4 years ago

@bblaha I refactored this module for v2. You can check it out on the develop branch.

cd ~/MagicMirror/modules/MMM-WienerLinien
git checkout develop
git pull
npm i

If you use config option incidentShort it should filter properly now.

bblaha commented 4 years ago

I have tried this and it worked, thank you for the quick reaction!

fewieden commented 4 years ago

@bblaha I have released the new version to the master branch. Just follow the steps above to switch the branch if you want.

Also good news, the API provider has already contacted me and fixed the issue. Therefore you can specify incidentShort: false again.