jsgoecke/tesla

SetTemperature defaulting passenger and driver temperature to "LOW"

pushc6 opened this issue · 3 comments

Not sure if this is just an issue with the model 3, but when setting the temperature via the command and putting the proper temperature in celcius the car sets the temperature to "LOW" which is 15 degrees C. Can you confirm this is working on the model s, or is this perhaps a change to the API? Currently researching, but don't have access to a model s to compare against.

I have the same problem. The fix:

--- a/commands.go
+++ b/commands.go
@@ -184,8 +184,9 @@ func (v Vehicle) LockDoors() error {
func (v Vehicle) SetTemprature(driver float64, passenger float64) error {
driveTemp := strconv.FormatFloat(driver, 'f', -1, 32)
passengerTemp := strconv.FormatFloat(passenger, 'f', -1, 32)

  •   apiUrl := BaseURL + "/vehicles/" + strconv.FormatInt(v.ID, 10) + "/command/set_temps?driver_temp=" + driveTemp + "&passenger_temp=" + passengerTemp
    
  •   _, err := ActiveClient.post(apiUrl, nil)
    
  •   apiUrl := BaseURL + "/vehicles/" + strconv.FormatInt(v.ID, 10) + "/command/set_temps"
    
  •   theJson := `{"driver_temp": "` + driveTemp + `", "passenger_temp":` + passengerTemp + `}`
    
  •   _, err := ActiveClient.post(apiUrl, []byte(theJson))
      return err
    

}

Confirmed, this happens with my Model 3 as well. I'm unclear whether making this change would break other Model users or not, can you investigate?