Xkhi / MMM-Vasttrafik-PublicTransport

Magic Mirror2 module to display information from public transportation in Västra Götaland, Sweden
1 stars 2 forks source link

stopId is not defined #4

Closed kallby86 closed 1 day ago

kallby86 commented 8 months ago

Hi I only get the Västtrafik logo when i start, i turned the debug on and get:

[26.01.2024 22:47.34.384] [DEBUG] generateAccessToken completed [26.01.2024 22:47.34.399] [DEBUG] stationid is array=true [26.01.2024 22:47.34.406] [DEBUG] Getting departures for stop id: 9021014005440000 [26.01.2024 22:47.34.415] [DEBUG] Access token retrived: Calling depatureBoard [26.01.2024 22:47.34.432] [DEBUG] Pushing promise for stop 9021014005440000 [26.01.2024 22:47.34.436] [DEBUG] Getting departures for stop id: 9021014005440000 [26.01.2024 22:47.34.439] [DEBUG] Access token retrived: Calling depatureBoard [26.01.2024 22:47.34.446] [DEBUG] Pushing promise for stop 9021014005440000 [26.01.2024 22:47.34.455] [LOG] 22:47:34 MMM-Vasttrafik-PublicTransport: One or more promises rejected ReferenceError: stopId is not defined

To get the stop id i go on developer.vasttrafik.se and get

{ "results": [ { "gid": "9021014005440000", "name": "Rambergsvallen, Göteborg", "locationType": "stoparea", "latitude": 57.719485, "longitude": 11.927526, "hasLocalService": false },

You now whats is wrong?

Zoonie81 commented 7 months ago

Hey dude, I'm pretty sure there is a mistake in your config.js. Make sure your stop id is inserted like following:

... config: { myStops: [ {id: "9021014005440000",} ], ...

Xkhi remade the id to an array of ids so we can track multiple stops, so if you enter it like above it should work.

/Z