Elaniobro / MMM-nyc-transit

MTA transit module for Magic Mirror
MIT License
21 stars 14 forks source link

[🐛 BUG] - If you don't specify a `walkingTime` parsing response fails #88

Open ParkMyCar opened 2 years ago

ParkMyCar commented 2 years ago

Describe the bug If you don't specify a walkingTime with each station, then you don't get back any train times, specifically the upTown and downTown lists are empty, because the time field for each trip is NaN

To Reproduce Steps to reproduce the behavior:

  1. In your config don't set a walkingTime
  2. Run MagicMirror, no trains show up

Expected behavior Expect train times to show up

Actual behavior No train times show up

ParkMyCar commented 2 years ago

I think the fix is to update this line to something like:

return formattedTime - (walkingTime || 0)

Although I haven't tested it

Elaniobro commented 2 years ago

@ParkMyCar care to submit a PR?

Elaniobro commented 1 year ago

@ParkMyCar; did your suggestion resolve your issue?

ParkMyCar commented 1 year ago

@ParkMyCar; did your suggestion resolve your issue?

It did! Sorry I never got around to submitting a PR

Elaniobro commented 1 year ago

Do you have time to do so now? 🙏