KristjanESPERANTO / MMM-PublicTransportHafas

This is a module for MagicMirror² to display public transport departures.
MIT License
21 stars 6 forks source link

Showing "+?" as a delay #163

Closed elgrwo closed 7 months ago

elgrwo commented 7 months ago

Bug description Under certain circumstances (I assume when no delay is known) it shows the time with "+?". (See screenshot)

Module config

{
      module: "MMM-PublicTransportHafas",
      position: "top_right",
      animate: "false",
      config: {
        stationID: "444006", //
        stationName: "Platform 2",
        direction: "442138",
        excludedTransportationTypes: "bus",
        ignoredLines: [],
        timeToStation: -620,
        timeInFuture: 820,
        tableHeaderOrder: ["time", "line", "direction"],
        fadeReachableDepartures: false,
        displayLastUpdate: false,
        maxUnreachableDepartures: 1,
        maxReachableDepartures: 3,
        showColoredLineSymbols: true,
        customLineStyles: "",
        showOnlyLineNumbers: false,
        showTableHeadersAsSymbols: true,
        useColorForRealtimeInfo: true
     }
},

Screenshots

Screenshot 2024-03-24 at 17 04 49 Screenshot 2024-03-24 at 17 10 28
KristjanESPERANTO commented 7 months ago

This happens when there is no real-time data for the departure. In such a case, it is not possible to know exactly when the train will depart or whether it will depart at all.

Just out of curiosity: Why are you using a negative value for timeToStation?

elgrwo commented 7 months ago

Thank you for the quick reply!

I see, that kind of makes sense now – however (as a comparison from a user perspective) for example the DB Navigator app does not differentiate from those trains where no real-time data is visible. As a user, one can optimistically assume it will be arriving and departing as planned originally, even if no real time information is available.

Maybe it would be possible to hide the "+?" with a config-option for the optimistic and to hide departures without real-time data for the pessimistic? 😆

I use a negative value for timeToStation hoping that it always shows the last past train, no matter how far in the past its planned departure was. Doesn’t really work though, I am quite new at this …

KristjanESPERANTO commented 7 months ago

Maybe it would be possible to hide the "+?" with a config-option ...

Sure. What do you think about a custom string instead of a boolean? Default would be "+?". If you don't wanna see it, you change it to "" - if you want only a ? you change it to "?" or even an emoji would be possible "🤷" ^^

I think I'll will implement this when I find the time. A PR would also be welcome! :smiley:

I use a negative value for timeToStation hoping that it always shows the last past train ...

Does maxUnreachableDepartures: 1 not do this?

elgrwo commented 7 months ago

Sure. What do you think about a custom string instead of a boolean?

Sounds fantastic!

I think I'll will implement this when I find the time. A PR would also be welcome! 😃

I really appreciate your work on this module! Unfortunately I lack programming skills, so I'm unable to contribute with a PR as of yet.

Does maxUnreachableDepartures: 1 not do this?

Will give it another go, thanks!

elgrwo commented 7 months ago

There is now a new config option: noRealtimeDelayString. Set it to "", than the delay string will no longer appear if there is no real-time data.

Let me know if it works for you too 🙂

works a charm!!! thanks for the great work on this module and your quick replies!!