Read the statement by Michael Teeuw here.
Transit module stopped working
-
@Elaniobro how does it use this.updateDom()
-
@sdetweil Its called in the
socketNotificationReceived()
here:
https://github.com/Elaniobro/MMM-nyc-transit/blob/master/MMM-nyc-transit.js#L358-L360 -
@Elaniobro where is self set.? and fadeSpeed?
-
@sdetweil They aren’t, they can be removed. Issue I am seeing is the payload is not populated indo the
getDom()
I am setting
this.result = payload
which on intitial load/start of the module is undefined, which is expected, since the API promise has not been fulfilled. Later on, thesocketNotificationReceived()
recieves apayload
which is set tothis.result
but in thegetDom()
var data = this.result
is never updated.I am unsure of where/what caused this breakdown, as last time I touched the code was Apr 30. This is leading me to believe something changed in Core, but I am unaware of what that might be.
-
@Elaniobro are u debugging w the developers window?
you can walk thru the code as it executes
ctrl-shift-i and select the sources tab, use the tree on the left to find your module, and it’s sourcethen click the left edge of a line of code u want to examine, and a stop will be added.
usually a problem like this is because the ‘this.’ pointer doesn’t point where u think it does.
sorry, I am in hospital for a few more days and cannot debug from here
-
@sdetweil Thank you for your feedback. I am/was already debugging in the manner you mentioned. I was able to resolve the bug(s), but now I am still not seeing any data. My best guess is somewhere along the fetch of the data something changed or broke. The application is returning data, but the response is empty.
payload = [{ downTown: [] }, { upTown: [] }]
For some reason, just not getting any data :/
I am still digging in.
-
@Elaniobro boooo. always something! let me know if I can help
-
@Elaniobro probably another ‘this’ pointer issue
-
@sdetweil Welcome to assist, you can find the repo here: https://github.com/Elaniobro/MMM-nyc-transit
I do have it cleaned up a bit locally, but I am thinking my API key is no longer valid and or something changed upstream that I am not aware of. The mirror is doing what it should and returning results array, but the array is empty.
-
@Elaniobro using the default config, i also see the lack of info
client.departures(stations) .then((responses) => { var upTown = [] var downTown = [] console.log("api results="+JSON.stringify(responses))
actual data
api results=[{"complexId":237,"name":"Carroll St","lines":[{"name":"6th Av - Culver","departures":{"S":[],"N":[]}}]},{"complexId":177,"name":"Clinton - Washington Avs","lines":[{"name":"8th Av - Fulton St","departures":{"S":[],"N":[]}}]}]
config
config: { apiKey: '****', // just granted displayType: 'marquee', mtaType: 'train', stations: [ { stationId: 237, walkingTime: 5, dir: { upTown: false, downTown: true } }, { stationId: 177, walkingTime: 5, dir: { upTown: true, downTown: false } } ],