bogosj / tesla

Provides a wrapper around the API to easily query and command a Telsa car.
Other
23 stars 18 forks source link

func (Vehicle) OpenTrunk Not Working #55

Closed Rudi9719 closed 3 years ago

Rudi9719 commented 3 years ago

Whenever calling the v.OpenTrunk("front") or v.OpenTrunk("rear") functions, I get an error 400 Bad Request. Was the API moved or were the names changed?

switch trunk {
    case "rear":
    case "front":
        err := v.OpenTrunk(strings.ToLower(trunk))
        if err != nil {
            handleError(err, m, "There was an error opening your trunk. Contact @rudi9719 for more information with code %+v")
            return
        }
    default:
        k.SendMessageByConvID(m.ConvID, "You must supply front or rear.")
        return
    }
Rudi9719 commented 3 years ago

I wasn't on the latest commit when I opened this issue, just wanted to confirm that it is still an issue in the latest commit. go get github.com/bogosj/tesla@0e5b7bb5e9240d8b9adc69242a364b36c7341938

bogosj commented 3 years ago

It looks like this possibly never worked? https://tesla-api.timdorr.com/vehicle/commands/trunk

Hi, can you checkout the code and try the trunk-fix branch?

https://github.com/bogosj/tesla/commit/f2a85198a07dd78034f98fa51061297ef52ef737

I believe this should fix it, but I'm not able to test right now.

Rudi9719 commented 3 years ago

That worked perfectly!

bogosj commented 3 years ago

Released as https://github.com/bogosj/tesla/releases/tag/v1.0.1