-
Notifications
You must be signed in to change notification settings - Fork 7
Adapt to probably changed model of return values. #1
base: master
Are you sure you want to change the base?
Conversation
@Joschbosch
|
@lavolp3 |
Hi. I do receive the following error: |
Ok, I also had the problem and just added a check for the problem which in my case worked fine. Also, the module is working correctly for me, having no errors. As far as I can see, I did not make any other changes. |
After some tries, if receive now the following error: |
I get this... UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'name' of undefined |
Mhh since I do not get this, could one of you post the config you use for the module? Maybe something is different there that leeds to the error. |
Hi, I also got this Problem. It worked for me until i updated MagicMirror. with the config attached i get |
Did you notice that there is a new portal for developers?: developer.deutschebahn.com After a free Registration you can use a couple of API's , like "Timetable-v1", "Fahrplan-v1", and also "StaDa-Station_Data-v2" |
I've got the same errors as described above on a fresh installed MagicMirror v2. Yes, the station ID needs to be a string, so in config.js type something like '123456789' instead of an integer. I as well got the error "Cannot read property 'name' of undefined" and fixed it in the DbFetcher.js. In fact the problem is in the "processData" prototype. The "data.forEach"-block fails to read the data of the response, because the structure changed. For example "row.product.name" ain't available anymore. Instead you have to use "row.line.name". The next error is the following line: Additionally the config "excludedTransportationTypes" wasn't used so far. I also added this to "processData". It's now working for me. @Pretowner: |
Can you send me your Changes? |
That's not working, I get my mails back telling me "Message rejected due to local policy". You need the two files "DbFetcher.js" and "MMM-PublicTransportDB.js". You might want to update db-hafas modul as well. |
@Corburn84 : Thanks, the both files and updating the db-hafas module helped! |
I still don't get the module to work. All I get ist a loading message. I copied the two files "DbFetcher.js" and "MMM-PublicTransportDB.js" in the module directory and deleted and db-hafas module and downloaded the latest version. I also tried to call the "MMM-PublicTransportDB_modiefied" module. Heres the code I'm using to call the module in the config.js:
|
You have to use a string as stationID. Same for value of "direction". |
@Corburn84 Great, thanks. It Works. |
Hi! Any ideas how to make the different product lines more stylish with different colors (like the original module)? Actually it doesn't work with |
Thanks for the hint. I recently fixed this bug in my repository. The returned type was wrong in the DBFetcher. I might gonna tune the style.css once more so that the cells aren't that close to each other. |
In the README.md it's written that stationId is an integer. So does it have to be changed there? |
Yeah, the README.md is wrong. |
Hey,
I wanted to use your module but it did not work properly. I had a look into it and made some changes, I think that the data model that is returned by hafas changed a bit.
Maybe my changes can help you or other to get it also working.
Cheers,
Josch