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

Unable to get Vehicle State #58

Closed
Rudi9719 opened this issue Jul 11, 2021 · 9 comments
Closed

Unable to get Vehicle State #58

Rudi9719 opened this issue Jul 11, 2021 · 9 comments

Comments

@Rudi9719
Copy link

Receiving the following error when calling

	vehicleState, err := vehicle.VehicleState()
	if err != nil {
		fmt.Printf("Unable to get Vehicle State: %+v\n", err)
		return
	}

Unable to get Vehicle State: json: cannot unmarshal number 50.0 into Go struct field .response.speed_limit_mode.min_limit_mph of type int

@andig
Copy link
Collaborator

andig commented Jul 11, 2021

Seems that would better be float- do you want to provide a PR?

@Rudi9719
Copy link
Author

Not sure if that's the issue, looks like it is already a float64?

	SpeedLimitMode struct {
		Active          bool    `json:"active"`
		CurrentLimitMph float64 `json:"current_limit_mph"`
		MaxLimitMph     float64 `json:"max_limit_mph"`
		MinLimitMph     float64 `json:"min_limit_mph"`
		PinCodeSet      bool    `json:"pin_code_set"`
	} `json:"speed_limit_mode"`

@andig
Copy link
Collaborator

andig commented Jul 11, 2021

Are you using an outdated version?

@Rudi9719
Copy link
Author

Rudi9719 commented Jul 11, 2021

I'm not sure; I just pulled it this morning so I don't think so? Unless I'm missing a tag or something

github.com/bogosj/tesla v1.0.0

@Rudi9719
Copy link
Author

Seems like there have been commits since the last release v1.0.0, maybe that's the issue? (Sorry, accidentally closed prematurely)

@Rudi9719 Rudi9719 reopened this Jul 11, 2021
@andig
Copy link
Collaborator

andig commented Jul 12, 2021

Are you using the latest commit (really same question as above)?

@andig andig mentioned this issue Jul 12, 2021
3 tasks
@Rudi9719
Copy link
Author

Not sure how to check with Go modules (required for go 1.16+). I assume that for therecipe/qt, and x/oauth with the v0.0.0, but then there's a timestamp of some sort followed by what I assume is the commit hash?

	github.com/bogosj/tesla v1.0.0
	github.com/therecipe/qt v0.0.0-20200904063919-c0c124a5770d
	golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914
	samhofi.us/x/keybase/v2 v2.1.1
)

@Rudi9719
Copy link
Author

go get github.com/bogosj/tesla@0e5b7bb5e9240d8b9adc69242a364b36c7341938 solved the issue, thank you!

@andig
Copy link
Collaborator

andig commented Jul 13, 2021

Or ….@main to fetch the latest commit.

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