Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

login-response may contain vehicle list #2

Closed
gym22 opened this issue Nov 28, 2017 · 3 comments
Closed

login-response may contain vehicle list #2

gym22 opened this issue Nov 28, 2017 · 3 comments

Comments

@gym22
Copy link

gym22 commented Nov 28, 2017

the login response may contain a vehicleinfolist instead of a single vehicleinfo:

          "VehicleInfoList": {
                    "VehicleInfo": [
                            {
                                    "charger20066":"false",
                                    "nickname":"LEAF",
                                    "telematicsEnabled":"true",
                                    "vin":"1ABCDEFG2HIJKLM3N"
                            }
                    ],
                    "vehicleInfo": [
                            {
                                    "charger20066":"false",
                                    "nickname":"LEAF",
                                    "telematicsEnabled":"true",
                                    "vin":"1ABCDEFG2HIJKLM3N"
                            }
                    ]
            },

(yes, one with a lower case v and another with upper case V)
currently, in that case, login-response.js throws an exception at line 57

A quick fix to get it going was to add before line 57:

 if (this.res.hasOwnProperty('VehicleInfoList')) {
    this.res.vehicleInfo = this.res.VehicleInfoList.vehicleInfo;
 }
@beejjacobs
Copy link
Owner

Good to know, thank you. I knew there would be cases I haven't caught because I can only test with my account. Is the second entry just a copy?!

I'll add in your change.

@gym22
Copy link
Author

gym22 commented Nov 29, 2017 via email

@beejjacobs
Copy link
Owner

Okay cool.

Version 1.0.6 has the fix in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants