deg0nz/MMM-PublicTransportBerlin

Odd fetcher crash

berlincount opened this issue · 9 comments

    {
      module: 'MMM-PublicTransportBerlin',
      position: 'top_left',
      config: {
        name: "U Pankstrasse",
        stationId: "900000009203",
        travelTimeToStation: 5,
        interval: 120000,
        departureMinutes: 30, 
        maxDepartures: 15,
        marqueeLongDirections: true,
        showColoredLineSymbols: true,
        useColorForRealtimeInfo: true,
        showTableHeadersAsSymbols: true,
        maxUnreachableDepartures: 2,
        maxReachableDepartures: 4,
        fadeUnreachableDepartures: true,
        fadeReachableDepartures: false,
        fadePointForReachableDepartures: 0.25
      },
      classes: 'default'
    },
    {
      module: 'MMM-PublicTransportBerlin',
      position: 'top_left',
      config: {
        name: "S+U Gesundbrunnen",
        stationId: "900000007102",
        travelTimeToStation: 12,
        interval: 120000,
        departureMinutes: 30,
        maxDepartures: 15,
        marqueeLongDirections: true,
        showColoredLineSymbols: true,
        useColorForRealtimeInfo: true,
        showTableHeadersAsSymbols: true,
        maxUnreachableDepartures: 2,
        maxReachableDepartures: 8,
        fadeUnreachableDepartures: true,
        fadeReachableDepartures: false,
        fadePointForReachableDepartures: 0.25
      },
      classes: 'default'
    },

gets me Error while fetching departures (for module Instance S+U Gesundbrunnen): TypeError: Cannot use 'in' operator to search for 'bg' in undefined, preventing rendering of this instance. The other one works.

This error seems to occur in node_helper.js at Lines 141-147.

It faults, when the variable color is undefined, which may only happens if the type of line is suburban, subway, tram or regional where we look up the colors in a table. I had the same problem but with the tram line 18 (which is not defined in the lineColors.tram array.
I am tbh not sure where you got the line colors and available lines from exactly but seems like there are some things missing.

I will open up a pull request to address this.

Thanks for finding this. The colors come from this module: https://github.com/derhuerst/vbb-line-colors
If there are missing colors, maybe this is an error which needs to be fixed in this module

Yeah. I think you found a bug in vbb-line-colors. It seems that there is a tram line 19 instead of 18 in the tram array, but according to Wikipedia, there only is a line 18.

Now, we just need to know, what is going on around Gesundbrunnen to address @berlincount's error. Obviously, there is another line missing that has a stop there. Tram 18 seems not to have a stop there...

I am guessing there is some sort of regional train missing?

The module does not seem to reference official sources right now (it's an open issue). Might look into it aswell.

I am guessing there is some sort of regional train missing?

The module does not seem to reference official sources right now (it's an open issue). Might look into it aswell.

I don't know, but I have an idea, how we can find this out easily. Just take your approach of #61 and make the colors more obvious.

It's the FEX! It runs over Hbf and Gesundbrunnen.
Your version of vbb-line-colors does not yet have the FEX included.

I have commited an update aswell.

I've created a PR over on vbb-line-color with the latest changes. If you want, you can watch and update your app when the PR gets approved and the package updated.

This issue should have been fixed with #61.

oh, wow - thank you! :)